Global API
Requests
NetSuite Custom Fields
7 min
you can find the below customfieldlist field name in all netsuite objects, use it to pass the custom fields list as a part of any create/update request 2 true 221,221,221 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type let's see how to add the custom fields in the request and what format the data is to be given customfields 221,221,221 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type customfieldinfo 221,221,221 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type the values of netsuite custom field type (helps in knowing the fieldtype) and the netsuite custom field api name (scriptid) can be known either by logging into netsuite or going to the custom fields tab on the breadwinner for netsuite page in salesforce in case of standard netsuite objects custom field types true 221,221,221 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type below is an example of constructing the customer custom fields as a part of the request request part // create a map to store all the data of a customer map\<string, object> nscustomer = new map\<string, object>(); // initializing the customer custom fields list\<object> custcustomfieldlist = new list\<object>(); // 1 check box custom fields map\<string, object> custcustomfield1 = new map\<string, object>(); custcustomfield1 put('fieldtype', 'boolean'); custcustomfield1 put('scriptid', 'custentity naw trans need approval'); custcustomfield1 put('value', 'true'); custcustomfieldlist add(custcustomfield1); // 2 free form text, text area, long text, email address, and hyperlink custom fields map\<string, object> custcustomfield2 = new map\<string, object>(); custcustomfield2 put('fieldtype', 'string'); custcustomfield2 put('scriptid', 'custentity my brn'); custcustomfield2 put('value', 'u72200mh2009plc123456'); custcustomfieldlist add(custcustomfield2); // 3 date and datetime custom fields map\<string, object> custcustomfield3 = new map\<string, object>(); custcustomfield3 put('fieldtype', 'date'); custcustomfield3 put('scriptid', 'custentity document date'); custcustomfield3 put('value', '1628091060'); custcustomfieldlist add(custcustomfield3); // 4 integer number custom fields map\<string, object> custcustomfield4 = new map\<string, object>(); custcustomfield4 put('fieldtype', 'long'); custcustomfield4 put('scriptid', 'custentity stc daysuntilexpiry'); custcustomfield4 put('value', '7'); custcustomfieldlist add(custcustomfield4); // 5 decimal number, currency, percent custom fields map\<string, object> custcustomfield5 = new map\<string, object>(); custcustomfield5 put('fieldtype', 'double'); custcustomfield5 put('scriptid', 'custentity stc discountpercent'); custcustomfield5 put('value', '76 89'); custcustomfieldlist add(custcustomfield5); // 6 list record/lookup custom fields map\<string, object> custcustomfield6 = new map\<string, object>(); custcustomfield6 put('fieldtype', 'select'); custcustomfield6 put('scriptid', 'custentity rating'); custcustomfield6 put('valuelookup', new map\<string, object>{'internalid'=>'2'}); custcustomfieldlist add(custcustomfield6); // 7 custom segment fields map\<string, object> custcustomfield7 = new map\<string, object>(); custcustomfield7 put('fieldtype', 'select'); custcustomfield7 put('scriptid', 'cseg lead source'); custcustomfield7 put('valuelookup', new map\<string, object>{'internalid'=>'2'}); custcustomfieldlist add(custcustomfield7); // adding the customer custom fields nscustomer put('customfieldlist', new map\<string, object>{'customfield'=>custcustomfieldlist}); date / datetime custom fields date the date value is accepted and returned as a unix timestamp in seconds example custcustomfield1 put('fieldtype', 'date'); custcustomfield1 put('scriptid', 'custentity date'); custcustomfield1 put('value', datetime newinstance(2026, 01, 09) gettime()/1000); // no time part when constructing unix timestamp because a timestamp includes a time factor, when we use a salesforce date field value for the unix timestamp, it represents the salesforce time based on the salesforce timezone hence, when it is sent to netsuite, it will be saved one day ahead or behind to resolve this issue, we need to construct a timestamp in gmt with a 12 hour time, so it does not cause any problems and adjusts itself in case of extreme salesforce and netsuite timezone differences custcustomfield1 put('value', datetime newinstancegmt(datetobeconverted year(), datetobeconverted month(), datetobeconverted day(), 12, 0, 0) gettime()/1000); date time the date time value is accepted and returned as a unix timestamp in seconds example custcustomfield2 put('fieldtype', 'date'); custcustomfield2 put('scriptid', 'custentity datetime'); custcustomfield2 put('value', datetime newinstance(2026, 01, 09, 15, 0, 0) gettime()/1000); // with time part when constructing unix timestamp
