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
Adding Related Items using custom records and script
It isn't currently possible to import related items records using csv. We are considering building a work around for this using script. However, we have hit a snag. It seems the format for the related item "kitem" field.
I have the following code:
function checkrelateditems()
{
var thisItem=nlapiLoadRecord("inventoryitem",41);
response.write("Lines:"+thisItem.getLineItemCount("presentationitem")+"");
thisItem.setLineItemValue("presentationitem","kitem",2,'44')
response.write("Lines:"+thisItem.getLineItemCount("presentationitem")+"");
nlapiSubmitRecord(thisItem);
}
NOTE: the space in the middle of "kitem" is just a display artefact of the user group
The first write line produces a length of 1.
The second produces a lenght of 2.