Hi all! Anyone knows if it is possible in runtime ...
# suitescript
d
Hi all! Anyone knows if it is possible in runtime to get the event that triggered the script? (Like, beforeSubmit or afterSubmit)?
🙌 1
b
probably need to give more context
its not normal for user event scripts to trigger other scripts
d
I'm writing a logging system for myself that will show some information about the environment in log header. Like: recordId, recordType, etc. I thought it would be useful to add information about script trigger as well.
But looking at N/runtime module I'm not sure it is possible.
Though, not a big deal, will add a parameter in constructor to specify it explicitly
b
you can probably guess what scripts it it by requiring the
module
module
but i dont think you can guess the entrypoint
if you are desperate, you can throw an error and catch it to look at the stacktrace
d
Hm. I don't see the "module" module in the list
Anyway, I'm not desperate, will just make user (me) specify the entry point explicitly
b
d
Oh, I see. Thank you!