Hi all, I have a Clientscript that runs on PageIni...
# suitescript
l
Hi all, I have a Clientscript that runs on PageInit that just stopped working, and I am curious if anyone could help me out. My Script loads the PO that the vendor bill was created from, and then assigns the calculated value to the quantity of the corresponding line item in the vendor bill based off of values in the PO. After debugging my code all of the values are correctly calculating but when the record loads the quantity field is still the quantity from the PO and not the calculated value:
//select the current line to change the quantity
currentRecord.selectLine({
sublistId: "item",
line: i
});
//set the value of quantity in the bill to be the difference between delivered and billed in the
currentRecord.setCurrentSublistValue({
sublistId: "item",
fieldId: "quantity",
value: difference
});
currentRecord.commitLine({
sublistId: 'item'
});
}
b
l
I've tried that, and it still hasn't worked
b
what did the attempt look like
l
currentRecord.setCurrentSublistValue({
sublistId: "item",
fieldId: "quantity",
value: difference,
forceSyncSourcing: true
});
&
currentRecord.setCurrentSublistValue({
sublistId: "item",
fieldId: "quantity",
value: difference,
forceSyncSourcing: false
});
I've tried explicitly setting it as false, and setting it to true
b
that looks reasonable
what does the rest of the code look like