Discussions
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
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.