Is there a way to simulate the [Bill] button on an...
# suitescript
s
Is there a way to simulate the [Bill] button on an Item Fulfillment record from script? Since
record.transform
doesn't support Fulfillment -> Invoice but the UI seems to?
g
You should transform the sales order into an invoice. Is the item fulfilled created from a sales order?
s
Aye, but I'm hoping for a way to do what that [Bill] button does - automatically select only the fulfilled lines and put those on the invoice.
g
You can set the itemreceive column to false for all item lines that shouldn't be on the invoice, like so: record.setSublistValue({ sublistId: 'item', fieldId: 'itemreceive', value: false, line: i });
s
thanks @gabyrdzlobaton. The gist of my question was to take advantage of the automation already embedded in that button. but If I have to code it so be it
👍 1
m
Check the URL parameters when you click the button in the UI and try using them as default values in the record.transform
s
Aye @michoel, tried some of those tricks before resorting to posting here 😕 I'm sure I've run into this before just forgot. Amazing that this isn't a native transformation given the UI experience.