Hey friends, I have this after submit script to ta...
# suitescript
w
Hey friends, I have this after submit script to take serial numbers from the inventory detail and set them in a custom text field on the item line on the item fulfillment. This is working fine for all items except for packages where no value is being set. The script logs are showing that the serial numbers are being pulled from the inventory detail, but for whatever reason it’s not saving on the transaction line
b
Kit items do not have serial numbers
their components do
grab the serial numbers from the kit components lines and then set it on the kit item line
w
Right, that was the point of: var rec = record.viewLineItemSubrecord(‘item’, ‘inventorydetail’,i); if(rec != null){
basically ignore all kits cause they won’t have inventory detail
b
you can't ignore the kit line. The component lines aren't real lines on the fulfillment, you can't set values on their lines. You need to take the values you would have set on the component lines and set it on the kit line instead
w
oooof i see… That’s confusing as I am able to retrieve the serial based on the components line ID/# and am able to set the value in the UI. I’ll have to think about how to roll up the component line values into the package line
Seems silly… Also what if you have two serialized components in the package.. Thanks for your help
b
are you sure you can actually save values in the component lines
you can set values in the ui, but they aren't saved
w
Yeah i can save in the UI