Team, I am trying to “detect” when users click on ...
# suitescript
a
Team, I am trying to “detect” when users click on “Save As” on a customer record. I need to clean up some fields when this happens. Any ideas on how detect this Save As? I have been trying with a User Event script, but the “type” seems “edit” then “create” and I cannot detect the Save As. Thanks!
r
If it existed, it would be here: context.UserEventType. It doesn't.
I also checked runtime.executionContext
b
the safe generic way is to set a checkbox to indicate that your script has run
and then when you see a create with that checkbox checked, then you know to run the logic again
this will also work for records that support copy, which is usually what you also want
you can also rely on fields that only exist on preexisting records, for example if you see a record being created with the
lastmodifieddate
already set, then the record was created from another
internally, netsuite uses the
nameorig
for this purpose
a
thanks a lot guys @reptar @battk