Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
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.