I'm trying to preserve a field value from an Item ...
# suitescript
u
I'm trying to preserve a field value from an Item Fulfillment after it gets billed and creates a Sales Invoice. I understand that you can't transform Fulfillments into Invoices, so most of the fields from an Invoice are from the Sales Order, leaving me with no reference points to call the Fulfillment on from the Invoice itself. Is there any client script entry point that gets called when you click the "Bill" button that creates the Invoice, or some way to preserve a value from a Fulfillment onto an Invoice?
b
nothing special, you can just use page init and get the item fulfillment
probably can do the same thing in a beforeLoad user event
u
thanks for the reply, but i'm not sure how exactly to call
pageInit
(or
beforeLoad
) from the Bill button. It's a Netsuite-default button, so is there any way to hook onto its execution? for clarification, this is the Bill button I'm referring to, in case there might be a misunderstanding.
I'm aware you can script a transformation with
record.transform
, but I'd like to relegate that task to Netsuite's default as much as possible since I just really need one field to carry over.
b
deploy the script on the invoice
use the url to figure out which which item fulfillment you should be getting
1
u
thanks for this. using
windows.location.href
on
pageInit
seems to have done the trick. thanks again @battk