NetSuite SuiteScript 2.0 fieldChanged – Get Cause Of Field Change

I have a 2.0 SuiteScript ClientScript that changes the value in a field based on a change to the value in another field, running off the fieldChanged event.

So, if the value in field XYZ is changed, I check its new value and set the value in field ABC accordingly.

I also have another field, DEF. If it’s value is changed, I check its new value and set the value in fields XYZ and ABC accordingly. Setting the value of fields XYZ and ABC, of course, fires the fieldChanged even for field XYZ, which changes the value of field ABC. But I don’t want that to happen in this instance – I set the value of field ABC based on DEF, and don’t want it reset based on XYZ.

So basically, if field XYZ is changed by user action, I want to set the value of the field ABC. But if field XYZ is changed by this script, I do not want to set the value of the field ABC.

I was hoping there was something in the currentRecord object that said the origin of the change, but there’s not. Is there any way I can determine how the change to field XYZ happened? Is there any way I can prevent the change to field XYZ prompting the change in the field ABC if XYZ was, itself, changed because of the change to DEF, rather than by user action?

Rookie Asked on August 20, 2021 in SuiteScript.
Add Comment
1 Answer(s)

You probably want to settle for using ignoreFieldChange in this case

Intermediate Answered on August 20, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor