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

SnakeMan2058
  • 77
  • 1
  • 11

1 Answers1

2

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.

bknights
  • 14,408
  • 2
  • 18
  • 31
  • That's what I was afraid of. I am reloading it after initial save, but then have this issue when trying to save it after adding address and banking info. Without that second save, addresses aren't added. All of this is in one Map step, so no worries there. Another thought, is there a way to tell when the called scripts finish? And I was planning to have a regular save as the last one so that the scripts run as expected - just after I'm done populating everything – SnakeMan2058 Mar 14 '18 at 15:14