hey all, im just trying to test creating a ‘very’ ...
# suitescript
t
hey all, im just trying to test creating a ‘very’ simple matrix product via SS1. have this:
Copy code
var parent = nlapiCreateRecord('noninventoryitem');
    parent.setFieldValue('matrixtype', 'PARENT');
    parent.setFieldValue('itemid', 'aaa test');
    parent.setFieldValue('subsidiary', 2);
    parent.setFieldValue('taxschedule', 4);
    parent.setFieldValue('custitem3', 23);
    var parentid = nlapiSubmitRecord(parent);

    var child = nlapiCreateRecord('inventoryitem');
    child.setFieldValue('matrixtype', 'CHILD');
    child.setFieldValue('parent', parentid);
    child.setFieldValue('itemid', 'zzz test child');
    child.setFieldValue('taxschedule', 4);
    child.setFieldValue('matrixoptioncustitem3', 23);
    var childid = nlapiSubmitRecord(child);
but it fails on the child submit with
Invalid parent reference key
and then the id of the parent. any ideas?