Skip to Content
0

Javascript in Adobe Livecycle form ByDesign

Oct 17, 2017 at 05:47 AM

88

avatar image
Former Member

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Benny Huang Oct 18, 2017 at 02:35 AM
2

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 18, 2017 at 08:10 AM
0

thank you Benny Huang Solution worked!

Share
10 |10000 characters needed characters left characters exceeded