SnakeMan2058
SnakeMan2058

Reputation: 77

Save without triggering user event scripts in SS 2.0

In SuiteScript 1.0, when calling save we have the option to pass disabletriggers true to avoid running user event scripts from a scheduled script. In my case, I'm using SuiteScript 2.0, and trying to save a vendor record before attaching address and contact details. But, various User Event scripts are triggered which save the vendor record and cause a RCRD_HAS_BEEN_CHANGED error in the original Map/Reduce.

Is there a way to avoid triggering user event scripts in SuiteScript 2.0?

For reference, in SS1.0:

nlapiSubmitRecord(salesorderrecord, {disabletriggers : true, enablesourcing : true});

But this doesn't appear to work in 2.0

Upvotes: 0

Views: 3223

Answers (1)

bknights
bknights

Reputation: 15367

It's gone.

It was a sometimes convenient hack but really it should never have been available. Almost every time I used it I wondered if I was breaking someone else's integration.

In your situation if you have to save the vendor record you should then reload it. If you are passing a record between map reduce stages. Don't. Not only are you potentially ballooning your storage you never have assurance that some other process won't alter your record in between. Even if you check "Submit all stages at once that does not mean other things are not happening that may pick up your record and alter it.

Upvotes: 2

Related Questions