Hi team, I’m working on a User Event Script for S...
# integrations
r
Hi team, I’m working on a User Event Script for Sales Orders in NetSuite. The goal is to trigger our middleware endpoint whenever a Sales Order is updated (e.g., status changes to Fulfilled) so the change can flow through to BigCommerce. The script is already deployed, but it doesn’t seem to be triggering: • I don’t see any execution logs in NetSuite. • Nothing is hitting the middleware endpoint. I’ve attached a screenshot of the script deployment details. Could you please help check if I’m missing something in the deployment setup (e.g., record type, execution context) or if additional configuration is required for Sales Order UES to fire? Thank you so much!
n
Execute As Role should be "Administrator"
Remove the Event Type and handle that in your script. Give your deployment a meaningful ID instead of system generated one.
r
For this particular case you will have to deploy a script on item fulfillment and build logic around that.
☝️ 3
n
Totally missed that - thanks @raghav
r
i am able to see the logs and the backend endpoint got triggered, Thank you so much for the help! @NickSuite, @raghav 🎉
👍 1
@NickSuite, @raghav could you please help me with this? I’d like to know the best way to detect when inventory stock is updated in NetSuite. I want to trigger my backend endpoint to update BigCommerce whenever an item’s quantity changes for a specific inventory item. In addition, I currently have a cron job running in my backend that fetches item stock every 15 minutes and updates BigCommerce. This works, but I’m not sure if it’s the right approach.
n
Inventory are impacted by multiple records such as inventory adjustments, transfer, item receipt, and item fulfillment. Having a cron job is fine but increase the interval from 15 to 60 unless you have high frequency of orders/POs
r
Thanks, @NickSuite! Out of the two approaches — using a cron job (with a longer interval) or triggering updates directly from records like adjustments, transfers, receipts, and fulfillments — which method would you recommend to follow?
n
I would stick with the cron job since there are too many records to cover.
r
Thanks a lot, @NickSuite , really appreciate the guidance! I’ll go ahead with the cron job approach.
Hi @NickSuite , @raghav I’m facing an issue where my User Event Script (attached to the Sales Order record type) is not triggering when I manually close a Sales Order. Here’s what I’m observing: • When a Sales Order is billed, the script runs successfully, and I can see the log entry:
Copy code
Received inventory update from NetSuite: {
    salesOrderInternalId: 2077233,
    poNumber: '2000050',
    fulfillmentRecordId: null,
    status: { code: 'G', text: 'Billed' },
    previousStatus: { code: 'G', text: 'Billed' },
    statusChanged: false,
    recordType: 'salesorder',
    eventType: 'edit',
    timestamp: '2025-10-06T10:06:20.217Z'
}
However, when I manually close the Sales Order (in the line items closed -checkbox), the User Event Script does not trigger at all — no logs or script execution appear. Thank you so much!
r
Standard close order button does not trigger user events, it always bugs me. There is a simple workaround for it. Create a userevent to display a custom close order button which calls the client script that closes all the lines on the sales order. Hide the original close button at the form level. Now your user events will get triggered when someone closes the sales order.
n
Or you can trigger on Edit and compare the Closed field of each line with old record. You are right @raghav. I didn't think it through.
r
No user events trigger when using the standard close button on sales order. So how will the edit context get triggered?
r
@NickSuite @raghav, thank you so much for the help, the issue been resolved as i am happy with the shipped status as an end.
• is it possible to set
discounttotal
altshippingcost
althandlingcost manuuly via reslets in the netsuite for the sales order
any idea regarding this ,@NickSuite @raghav , need help !🙃
n
You need to set related fields and these will auto populate.
For discount, use discount rate field. For shipping cost, set shipping cost field.
r
@NickSuite @raghav — Thanks for the guidance. Following up to clarify: Current behavior: NetSuite is auto-calculating totals from the line items (item rate × quantity). The subtotal and tax fields are updating correctly. Our question: When syncing BigCommerce orders via RESTlet, should we: 1. Send the BigCommerce values for Shipping Cost and Handling Cost in the payload, or 2. Let NetSuite handle these through its internal configuration (i.e., not send them)? When I didn’t send the shipping and handling cost values from BigCommerce, the fields in NetSuite remained blank. Does this indicate that NetSuite’s configuration for auto-calculating these values isn’t set up? Basically — I’m trying to understand whether BigCommerce data should take priority, or if NetSuite is expected to calculate these amounts automatically. Example: If BigCommerce shows shipping = $10, but we don’t include that in the payload, should NetSuite automatically calculate the shipping cost based on its configuration, or will it remain blank (as it currently does)? I also tried explicitly sending the BigCommerce shipping and handling values in the RESTlet payload along with the other item data, but the fields still appear blank in the NetSuite sales order.
n
For integration, it is best to get these details from the external system.
🤝 1
r
I tried passing values to the shipping cost field (
fieldId: altshippingcost
), but it’s not reflecting. Is it possible to set it directly like this, or do we need to make changes in the line items? The end goal is whatever comes in the BigCommerce webhook response to be mapped and set in the corresponding NetSuite fields. Right now, the shipping cost isn’t being set. pls help
n
Use the "shippingcost" field.