Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
Count Line Items
I have been working on the following script that we want to count the number of line items if the custom column field ecertificate = T and the item type name is serialized inventory.
I am getting this error: ReferenceError: "CountTotal" is not defined. (Digital Delivery Count .js#8)
function calculatedigitaltotal() {
for( var i = 1; i <= nlapiGetLineItemCount('item'); i++) {
var eCertificate = nlapiGetLineItemValue('item', 'custcol_ecertificate', i );
var itemTypeName = nlapiGetLineItemValue('item', 'itemtype', i);
if ( eCertificate == 'T' && itemTypeName == 'Serialized Inventory Item') {CountTotal = eCertificate++
}
}
nlapiSetFieldValue('custbody_ecertificate_count', CountTotal, false, false);
return true;
}