Hi All, is user event script for one record should...
# suitescript
s
Hi All, is user event script for one record should be triggered when I create this one record via another user event script from another record. For example (not part of my code, just to clarify the idea): I`ve user event script for Journal entry that checks if memo is not missing in lines (if missing, throwing error and prevent submit). I`ve another userevent script in Customer payment transaction which create new journal entry transaction. The code in customer payment looks something like this: var je=record.create({type:'journalentry'}) entering data for je fields......(date,currency, etc....) je.save() The question is if JE script (for checking memo) invoked automatically when function record.save() issued in Customer Payment transaction, or no and I actually have to write new code for checking memo in Customer payment user event script?
e
💯 1
s
Understood, thanks.
e
You might extract the common logic into a module that both User Events can leverage. You might also offload the
save()
call from the first User Event to either a Suitelet or Restlet, which would then trigger the second User Event.
c
Can also use a workflow action script which will trigger a UE so UEs can trigger UEs just not with typical scripting