Hi, I am having an issue creating matrix child it...
# suitescript
t
Hi, I am having an issue creating matrix child items in suitescript 2 and was wondering if anybody has come across a solution (even in Suitescript 1). The matrix parent is being created successfully. The error I am getting is
Copy code
"msg": {
                "type": "error.SuiteScriptError",
                "name": "UNEXPECTED_ERROR",
                "message": null,
                "stack": [
                    "anonymous(N/serverRecordService)",
                    "onRequest(/SuiteScripts/SuiteFunction/RPS/SF_create_item_option2.js:80)"
                ],
                "cause": {
                    "type": "internal error",
                    "code": "UNEXPECTED_ERROR",
                    "details": null,
                    "userEvent": null,
                    "stackTrace": [
                        "anonymous(N/serverRecordService)",
                        "onRequest(/SuiteScripts/SuiteFunction/RPS/SF_create_item_option2.js:80)"
                    ],
                    "notifyOff": false
                },
                "id": "9498b166-eb08-44c4-ac1b-3c78c485ee33-2d323031392e30322e3139",
                "notifyOff": false,
                "userFacing": false
            }
from the attached code snippet Any help is much appreciated Thanks
b
I don't think matrix items via suitescript are supported well in general
you probably want to set the matrix field on the child item instead of custitem_fsg_size
Copy code
Child.setValue({
    fieldId: "matrixoptioncustitem_fsg_size",
    value: '2'
  });