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
Updation of Customfield
Hi,
We have created a custom field in salesorder.When we try to update that custom field it is giving the error as
Error Code: INVALID_KEY_OR_REF
Error Message : The Specified key is invalid. I have given the code below.
Can u pls help me out where i did wrong
SelectCustomFieldRef sel = (SelectCustomFieldRef)salesOrderHeader.itemList.item[j].customFieldList[0];
SelectCustomFieldRef listCF = new SelectCustomFieldRef();
listCF.internalId = sel.internalId;
ListOrRecordRef listRef = new ListOrRecordRef();
listRef.internalId = "1";
listRef.typeId = "24";
listCF.value = listRef;
CustomFieldRef[] cfRefs = null;
cfRefs = new CustomFieldRef[1];
cfRefs[0] = listCF;
SalesOrder sales = new SalesOrder();
sales.customFieldList = cfRefs;
WriteResponse wres = cnw.update(sales);
Thanks for the help in advance,