on 10-17-2017 6:47 AM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you bennyhuang Solution worked!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.