Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
How do I setFieldValue on Boolean on loaded record
I get an error message when trying to set a Boolean custom body field to TRUE on a loaded record in SuiteScript. The logic is basically:
fuction test()
{
var searchresults = nlapiSearchRecord('salesorder', 54, null, null);
for ( var i = 0; searchresults != null && i < searchresults.length; i++ )
{
var searchresult = searchresults[ i ];
var record = nlapiLoadRecord(searchresult.getRecordType(), searchresult.getId() );
record.setFieldValue('custbody_gp_calc', T);
var id = nlapiSubmitRecord(record, true, true);
nlapiLogExecution ('DEBUG', 'SAVEDID', id);
}}
I get the following error message:
ReferenceError: "T" is not defined.
or something similar on everything I try. I've tried "T", "TRUE", "true", "1".
What am I missing?
Thanks,
Scott