This script currently is working as intened except...
# suitescript
j
This script currently is working as intened except for 1 issue. We only want the Custbody_serial_number set IF there is a serial number in the lineitemvalue. Currently there are situations where we dont have it on the line item and we manually enter it in the custbody_serial_number field. Right now the script over rides the manual entry and leave the field blank if the serial number isnt on the lineitem column.
m
Copy code
if(itemsn) {
salesrecord.setFieldValue('custbody_serial_number', customsn);
}
Replace the last line in the screenshot with this. Basically says if itemsn variable contains a value, do this. If not, don't.
j
So replace salesrecord.setFieldValue('custbody_serial_number', customsn); with what you have?
m
As you explained it, yes
j
That seems to have worked! Thank you very much