Change the value of a General or Accounting preference using SuiteScript

To change the value of a General or Accounting preference using SuiteScript 2.0, you must load each preference page using config.load(options) in N/runtime Module

where options.name is COMPANY_PREFERENCES or ACCOUNTING_PREFERENCES.

The config.load(options) method returns a record.Record.

You can use the Record.setValue(options) method to set the preference.

You can use the Record.getValue(options) method to get the preference.

Example

 let configRecObj = config.load({
    type: config.Type.COMPANY_PREFERENCES
     });
       fieldValue=configRecObj.getValue({fieldId:"fieldId"});

Leave a comment

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