Search code examples
clientfieldsuitescript

How to use Script to set a Netsuite System Field as Mandatory?


I have a Client Suitescript 2.0 that handles some logic on fieldChanged for Sales Order records. This includes setting some fields as mandatory/non-mandatory according to certain criteria.

It works perfectly, except when I attempt to set a Netsuite System field (such as 'memo') as mandatory/non-mandatory.
Nothing happens, and no error.

The code used on all fields is context.currentRecord.getField({fieldId: 'memo'}).isMandatory = true;

Does anyone know why this issue would occur, or know of any workaround?

Many thanks!
Giles


Solution

  • try this

    var memo = context.currentRecord.getField({fieldId: 'memo'});
    memo.isMandatory = true;