Monday, December 31, 2018

Convert an nlobjRecord or any Object Record into a JSON String

Question: How to convert an nlobjRecord or any object record into a JSON String?

Answer:

Refer to the sample code below showing how to convert an nlobjRecord to a JSON String, have the below code execute on NetSuite Debugger:

var custrRec = nlapiLoadRecord('customer', 1);
var jsonstr =  JSON.stringify(custrRec);
nlapiLogExecution('DEBUG', jsonstr);

No comments:

Post a Comment