I am looking to build my first user event suitescr...
# suitescript
h
I am looking to build my first user event suitescript and was wondering how the testing phase works? Will it only trigger on csv's that I upload and new records that I create or is it more of an all or nothing implementation?
z
Depends what event type you have the deployment set to or if you are checking context in the script before you run your logic.
Ideally you have a sandbox to test in, but if you don't, you can set the status of the deployment to testing and it will only run for your user.
Like this will only trigger the log logic if the context is create.
Copy code
if (context.type !== context.UserEventType.CREATE) {
log.debug('triggered', 'on create)
};
h
Ideally the goal for the script is validate a SO and if it meets specific criteria on its creation an after submit function will add an item. So I am looking at a user event that I can test on my own accord and then implement when it is functioning. Thank you for the article. I will read up a bit more on it
b
performance wise, you really want to try beforeSubmit first
afterSubmit will require you to save the record again, which will basically double save time
👀 1