This topic contains 2 replies, has 0 voices, and was last updated by Xiaoxin Lee 6 years, 9 months ago.
-
AuthorPosts
-
January 16, 2018 at 8:58 am #21348
Xiaoxin LeeDoes 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');
recMatrixParent.setFieldValue('matrixtype', 'PARENT');
recMatrixParent.setFieldValue('cogsaccount', 794);
recMatrixParent.setFieldValue('assetaccount', 738);
recMatrixParent.setFieldValue('taxschedule', 2);
var arrColor = [1,2];
// define the Item's options
recMatrixParent.setFieldValue('custitem33', arrColor);
var idMatrixParent = nlapiSubmitRecord(recMatrixParent);
}
================================================
This is a cached copy. Click here to see the original post. -
January 20, 2018 at 6:14 pm #21349
pcutlerFor a multi-select, you want setFieldValues (plural):
// define the Item's options
recMatrixParent.setFieldValues('custitem33', arrColor);
-
January 26, 2018 at 4:58 am #21350
Xiaoxin LeeGood point.
But it produces same error results again.
lisa.reed replied on 02/27/2018, 11:10 AM: Did you solve this? I am looking for ways to convert existing items to become child items and to upload the parent item to link it to. Client went live without implementing matrix items and now wants this feature! Any ideas!
-
AuthorPosts
You must be logged in to reply to this topic.