<@UA4ATEE59> you could use a suitelet to update th...
# suitescript
j
@NElliott you could use a suitelet to update the custom record, that would cause the UE to trigger. You would just call your suitelet from the UE After Submit of the SO.
👍 1
a
@jmacdonald & @alien4u: How do you setup the Suitelet in terms of access control? Do you create a Suitelet with "Available without login"?
a
@Albert Margarit (NS Eng Lead) I always avoid
Available without login
...
a
Makes sense to me. How do you setup the Suitelet then?
How do you manage to get the User Event to call the Suitelet? Do you transfer the cookies of the original request to the URL request? I may be missing something here..
j
I typically use Available Without Login. If it's sensitive then I'd likely use another method to avoid exposing suitelets externally. It would be handy if we could call Suitelets from within Server Side scripts without having to add authentication.
a
Well in that particular case you may want to use Available Without login or try a different approach or do it from the client side on save or something like that...
a
I think the only two ways I know to call a Suitelet from a UserEvent is to do 1) the "Available without login" which obviously is a security threat and I would say risky and 2) passing the cookies of the original request to the suitelet call which I have never tried and don't know how easy it is
I was wondering what approach you guys use
a
At some point you will end up changing your approach is what I normally do... as right now I have over 250K lines of code in my repo(excluding comments) and I don't call a suitelet from any of my UE scripts...(around 80)...
j
I only really use the Suitelet approach if something is required to immediately update, if it's not time vital I'll defer to a scheduled or map/reduce script to handle it.
a
So how do you delegate the nested user event to a scheduled script? Do you create a scheduled script in the original UserEvent for the nested record to trigger an extra saved asynchronously?
j
Sorry that may have been confusing, I'd typically move the functionality from a UE script to a Map/Reduce and pass in the ID of the record that I've updated, so the original UE starts the M/R script. I think I may have used a Scheduled script to update a checkbox on a record before which then in turn will activate the UE, it depends on the use case but that often obfuscates issues.
a
I see. Understood.