cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript in Adobe Livecycle form ByDesign

0 Kudos

Hi,

I'm having some trouble with the Javascript inside my SAP ByDesign Template Forms.

It seems that the printout will not work when I assign some value to a variable. Very strange.

For example this works:

 FormDeliveryNoteNotification.bdymain.tblMain.rowMain.colQ::initialize - (JavaScript, both)
var tempHolderVal = frmProduct.txtID.formattedValue;
var height;
var length;
var width;
var each;
/*
height = parseInt(tempHolderVal.substr(1,2));
width = parseInt(tempHolderVal.substr(3,3));
length = parseInt(tempHolderVal.substr(6,2));
height = 24;
width = 145;
length = 36;
*/
this.rawValue = "36"; <--- Here I assign manually value to this.rawValue and everything else is commented out.
/*
var volume = (height * 0.001) * (width * 0.01) * (length * 0.01);
var totalQuantity = frmQuantity.decQty.formattedValue;
var quantity = totalQuantity / volume;
this.rawValue = quantity.toFixed(0);
*/

In the above I get value 36 to appear in the prinout in SAP ByDesign.

But when I do like this for example:

FormDeliveryNoteNotification.bdymain.tblMain.rowMain.colQ::initialize - (JavaScript, both)

var tempHolderVal = frmProduct.txtID.formattedValue;
var height;
var length;
var width;
var each;
/*
height = parseInt(tempHolderVal.substr(1,2));
width = parseInt(tempHolderVal.substr(3,3));
length = parseInt(tempHolderVal.substr(6,2));
height = 24;
width = 145;
*/
length = 36;
this.rawValue = length; <--- Now nothing appears in the prinout
/*
var volume = (height * 0.001) * (width * 0.01) * (length * 0.01);
var totalQuantity = frmQuantity.decQty.formattedValue;
var quantity = totalQuantity / volume;
this.rawValue = quantity.toFixed(0);
*/

When assigning some value to a variable and then assigning this variable to this.rawValue nothing appers in the screen.

Inside Livecycle preview the whole script works and javascript is valid also.

Anybody have experience with this? What is the problem? Is there any way to debug the printout inside SAP ByDesign?

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member200995
Contributor

Hi Villem,

Your script is very good, when I test using your code, the same issue, but the problem is not the script.

The point is "var length", you can not use the "length" as the var name, you can use another name, for example "length01" or "length02".

Best Regards,

Benny

0 Kudos

thank you bennyhuang Solution worked!