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
Creating Matrix Item
Does anyone have succeeded to create Matrix Parent and Child Item by script?
Recently, I have tried to create Matrix Parent Item.
First of all, set values on 'itemid', 'displayname' fields and set 'matrixtype' field as 'PARENT'.
For mandatory fields, set 'cogsaccount', 'assetaccount', 'taxschedule' fields with suitable values.
After defining the Item's options part, tried to submit parent record using nlapiSubmitRecord function.
But the Execution Log shows such result.
UNEXPECTED_ERROR: null
Is there a way around this?
Thanks,
Xiaoxin
Here is the code snippet.
===============================================
function suitelet(request, response){
var recMatrixParent = nlapiCreateRecord('inventoryitem');
recMatrixParent.setFieldValue('itemid', 'Matrix Parent');
recMatrixParent.setFieldValue('displayname', 'Matrix Parent');