SuiteScript error : “Netsuite Invalid API usage. You must use getValue to return the value set with setValue”

DESCRIPTION

When a new record is created and saved, this error gets thrown. But when editing this transaction after it was created, the getText does not throw this error. 

SOLUTION/POSSIBLE CAUSE

In dynamic mode, we can use getText() without limitation but, in standard mode, limitations exist. In standard mode, you can use this method only in the following cases:

  • You can use getText() on any field where the script has already used setText().
  • If you are loading or copying a record, you can use getText on any field except those where the script has already changed the value by using setValue().

Leave a comment

Your email address will not be published. Required fields are marked *