I was reading through the SAFE guide and came acro...
# suitescript
e
I was reading through the SAFE guide and came across this section on resaving a record in afterSubmit. This seems obvious, but the one place we do this - setting a record externalid value - doesn't seem to have a good workaround so I'm curious what others do.
e
Also interested, I send the second save operation to a scheduled script
a
are you not able to set an external id in beforeSubmit?
I was able to set this on record create before doing my save action, so I'm curious why you'd need to always set extids in afterSubmit?
are you setting the extid to equal something which CONTRAINS the internal id? that I could understand you woudnt have the internal id until aftersubmit
c
There are valid reasons to do a submitFields or save on an afterSubmit so I wouldn't 100% agree with the SAFE guide
e
@Anthony OConnor From what I can tell, you can set the externalid on create if you're calling a record.create() in SuiteScript. But if you're creating a record through the UI and trying to set the externalid on the beforeSubmit() of that record it will not work.
a
I mean its a guide anyway not a law - its a best practice to avoid that, but if you can't, you can't
z
No problem if after submit script is post processing with no MUST DO IT. Your transaction will be saved even after submit throw an error