Hi all, hopefully easy question that I am overthin...
# suitescript
c
Hi all, hopefully easy question that I am overthinking - does a user event script run no matter what has edited the record? Trying to run some automation on Item Location Configuration and have noticed they'll occasionally be created by System - would a UE script run in these instances?
i
It runs on whatever Audience, Context, and Event Type has been set on the Script Deployment
And yes scheduled workflows, scheduled scripts, map/reduce, etc can trigger a UE Script. However, a UE script will not trigger another UE script
c
Ok great, thanks for the quick response!
s
UE script can trigger another as well. Recently, I've created an Invoice Automation project. I've written 2 UE scripts and SL for this project. The first one was attached to IF, and the second was attached to Inv. When If is submitted, I've described to create the corresponding invoice and it triggers the second UE script to create appropriate journals to make that paid in full.
i
What role does the SL play in your flow?
a
UE scripts can't trigger UE scripts..... directly if your UE (script 1) calls a suitelet, then that suitelet can create a record and the UE (script 2) on that created record will trigger
☝🏻 1
s
yeah in my suitelet, it saves the submitted inv.
indirectly possible.😄
i
lmao…that’s exactly my initial message I guess I should’ve mentioned a UE script will not natively call another UE script. Can definitely be customized by calling an intermediary script.
👍🏻 1
c
So huge chunks of this are going over my head but just wanting to check if anyone knows off the top - my aim is to create a UE script that runs on Item Location Config creation to check if the Count Interval and Next Count Date are blank, and if so, add values. If some other script\ fires to create an Item Location Config (seems to happen when a Spot Count from Smart Count happens or when an item is received to create the record and set the Purchase Lead Time...) would you expect a UE script set to context create to fire?
s
it will be automatically triggered whenever a new record is created. you can implement that in beforeSubmit function
or build CS script to validate in front-end side
r
I have found that for system generated records like amortization journal, the UE scripts are not triggered
m
I have found that for system generated records like amortization journal, the UE scripts are not triggered
Depends on your journal approval settings