I'm having problems creating part relationships through a method. I have an array of arrays containing data that I want to use to generate a number of parts and their BOM relationships. The parts are being created properly but when i try to generate the BOM relationships, only the first child of each parent is added to the BOM. I'm using the loop below to try and create the BOM relations. I can see during debugging that I'm getting the right child and parent pairs, but only the first child is added to each parent.
for (i = 2; i < (nrows-1); i++)
var p_index = par_i[i-2];
var child = parts[i];
var parent = parts[p_index];
var bomItem = inn.newItem("Part BOM","add");
if (data[i] == "Yes")
parent = parent.apply();
Has anyone experienced a similar issue? How can I add multiple child parts to the BOM? I'm using Aras 11 SP12.