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
Simple script issue Submit NOT working
I am trying to create an inventory item in suitescript but I keep getting the following error Invalid reference key [null].
This code is called on an aftersubmit basis on a Custom record:
function setItem()
{
title = "test inventory item";
newRecord = nlapiCreateRecord('inventoryitem');
id = newRecord.getId();
newRecord.setFieldValue('itemid',"test inventory item");
type = newRecord.getRecordType();
newRecord.setFieldValue('cogsaccount',122);
newRecord.setFieldValue('assetaccount',121);
newRecord.setFieldValue('department',"Glasgow Opportunities");
newRecord.setFieldValue('class',"O.D.C : Training : Bespoke Training (Large Project");
newRecord.setFieldValue('purchasetaxcode',"Go:GO-na");
newRecord.setFieldValue('salestaxcode',"Go:GO-S");
debugTxt = "newRecord is "+newRecord+id+type;
nlapiLogExecution('DEBUG','<Before Load Script>',debugTxt);