Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
How do I make sure I'm grabbing the correct record ID when using a User Event Script?
I'm creating a script that sends an email after an item fulfillment has been marked as shipped.
Here is a small sample of my script. It's all ready to go except I'm not sure how to dynamically grab the record ID of the item fulfillment that was just marked shipped. Is there a way to use scriptContext to store the item fulfillment id as the parameter to the afterSubmit function?
define(['N/email', 'N/record'],function(email, record) { function afterSubmit(scriptContext) { var fromId = 450103; // my internal ID var itemFulfillmentId = ''; //THIS IS THE RECORD ID I NEED TO GRAB //loads item fulfillment var itemFulfillment = record.load({ type: record.Type.ITEM_FULFILLMENT, id: itemFulfillmentId, isDynamic: true }); 0