What do you mean?
# suitescript
k
What do you mean?
s
I meant I dnt want to change anything in UE
k
Sorry You dont want to change anything in the UE?
s
Yes
l
sorry @samyt, there's no other way to do it but to add a context checker to the script.. currently there's no UI-level switch to let you choose if you want user event scripts to fire for a scheduled script context or not
l
if you do not want to touch user even there is only one idea that came into my mind, but complex and not sure if I would recommend it - you can create a custom record. Create new user event on this custom record which will actually update the record you were updating earlier with scheduled script. Your scheduled script can create those custom record causing user event on custom record to trigger. Since user event cannot trigger user event it should work, but as I said - do it on your own risk, as at some day you may actually want user event to get triggered
s
@lukasz Yes, That make some sense. Doesnt a userevent trigger a userevent ?
l
that's one of the main rules in NetSuite - user event cannot trigger another user event. It was probably added to reduce a risk of infinite loop of user events
s
Not even records of different type? For eg: If I load a record A in user event of record B. Will the userevent get triggered?
l
test it - I had a user event on case creating a sales order and user events on sales order were not triggered
n
Yes, UE can't trigger another UE. This was added a few releases back so that they don't run into loops. But yeah, seems like an idea. You can utilize this actually, because no matter what, a UE won't fire another UE.
s
Oh interesting! Thanks alot 🙂
Will work on it
l
but as I said be careful - some day somebody may waste few hours trying to figure out why user event was not executed 😉
l
@lukasz I thought about your approach for a minute and thought that it could work but like you said I wouldn't recommend it.. it's really complicated and requires additional resources (custom record and additional user event script and some other complicated logic)@samyt I would pause for a moment there and re-think why you had that need in the first place.. there might some refactoring that needs to be done.. sometimes we complicate things while there is a simpler way available. 🙂 just an advice..
l
Agree with @Lea CC - you may regret it someday, so better to think it through. @Nik - do you remember when it was added, I thought it was there from the beginning (that was one of the first rules I learned in NetSuite like 9 years ago)
n
I too agree with @Lea CC & @lukasz. Would probably suggest that you find an alternate approach, if possible, for the whole scenario.
@lukasz I don't really remember because I started working on this not that long ago. But yeah I did went through most of Netsuite's documentation. Lol that's some tens of thousands of pages.
l
I think they should give you some kind of 🎖️ for doing that 😉
s
@Lea CC @lukasz Yes, I have to come up with something else. anyway thanks alot
n
Lol. I would in turn give them a medal for the documentation they have written. Lol. 😛 Also, to the people who have provided appropriate documentation for the undocumented API(s). A salute to them.