I have a SuiteScript that edits two custom fields ...
# general
m
I have a SuiteScript that edits two custom fields (number of line items and total units) when a transfer order is created. It works great when a user creates the transfer order through the UI but doesn’t run when the transfer order is created by our integration with Celigo (which accounts for 99% of the TO’s we generate). Any thoughts?
s
Check the context filtering on the deployment record, it's prob not running in a certain context that celigo is creating these under.
s
Is it a User Event script, or Client script?
m
@scottvonduhn User event script...I followed a tutorial I found online
@Sandii It has all contexts except web store and web application...how do I find what context Celigo is using?
s
best approach is to first enable all contexts that you can, then add a line at the beginning of your UE script to log the execution context type. Then check the logs to see what context it is using
m
There are a few types within the Celigo contexts as well but I'd imagine it would be either RESTlet or Suitelet or Web Services. Echo Scott's direction but if you've already done that, it might even be something else
m
So here is a new twist...I switched the owner of the script to the Celigo account and it worked properly, but now I cannot get it to work from my account in the UI. Is there somewhere to define what accounts are allowed to run the script?
s
Sounds fun
m
Look at the audience tab on the script deployment
b
if this is your first user event script, make sure you understand how Setting Script Deployment Status and Defining Script Audience works.