Here two fun ones: - Attach a Client Script to the...
# suitescript
a
Here two fun ones: • Attach a Client Script to the Address form(sub-record), put a console.log in
pageInit
, create a Sales Order and select a Customer, enjoy how your Client Script(attached to the address form) is triggered and the browser
console
complains about
console
not being defined. • From the same Client Script above do a
record.submitFields
to another record which has a UE deployed, enjoy how the submitFields triggers an EDIT event and also how
runtime.executionContext === runtime.ContextType.USEREVENT
. This is like saying an UE is being triggered by UE context (which should not be possible).
c
submitFields does trigger UEs though
m
@creece But shouldn't it be as an
XEDIT
(unless it's a record type/field that isn't available for inline editing)?
And the
runtime.executionContext === runtime.ContextType.USEREVENT
bit seems weird to me as well, it would make context filtering in UEs trickier.
c
Yeah it should be XEDIT but the fact its triggering a UE isn't surprising.
s
I think I remember a thread about how if you record.submitFields on fields that are not inline editable, it actually triggers in EDIT mode instad of XEDIT
c
Honestly never heard of that but it sounds like thats how it works
s
it is functionally doing the record.load/set/save behind the scenes for you
a
@creece You are right no surprise
submitFields
triggering UE, but triggering
UE
with
EDIT
event and also with
runtime.ContextType.USEREVENT
when this is coming from a
Client Script
is weird.
c
Sounds like you gotta talk to NetSuite support for a bug maybe
good luck with that buddy šŸ˜„
b
your first point is probably the result of Client Scripts Attached to the Address Subrecord
in which case, your client script really was triggered in the before load of a user event script
addresse client scripts are an exception to client scripts dont run serverside
my guess for the edit vs xedit is @Sandii guess
a
@creece I don't need luck to handle that with support because is not happening hahaha šŸ˜‚ I don't have the patience or the will to deal with NetSuite support anymore.