gnuwolf
06/17/2019, 7:20 AMvar recData = {
custrecord_fb_ed_from_item : arrMatrixItems,
custrecord_fb_ed_customer : recipient,
custrecord_fb_ed_date_sent : currDate,
custrecord_fb_ed_sentby : currentUser,
custrecord_fb_ed_project : project,
custrecord_fb_ed_docs : arrDocInfo.join('<br/>'),
custrecord_fb_ed_msg : request.parameters.message,
custrecord3 : ccrecipient
};
for ( var key in recData) {
if (recData.hasOwnProperty(key)) {
objRec.setValue({
fieldId : key,
value : recData[key]
});
}
}
var id = objRec.save({
enableSourcing : false,
ignoreMandatoryFields : false
});
arrMatrixItems is an array = ["43546","41957","40175","40174"]
and the error thrown is:
{"type":"error.SuiteScriptError","name":"INVALID_FLD_VALUE","message":"You have entered an Invalid Field Value 43546\u000541957\u000540175\u000540174 for the following field: custrecord_fb_ed_from_item","stack":["anonymous(N/serverRecordService)"
please note that this works on other instance. For some reason 'arrMatrixItems' is reading it with delimiter '\u0005' rather as an arraybattk
06/17/2019, 8:27 AMbattk
06/17/2019, 8:35 AMgnuwolf
06/17/2019, 10:26 AMgnuwolf
06/17/2019, 10:27 AMgnuwolf
06/17/2019, 10:30 AMarrMatrixItems = ["43546","41957","40175","40174"]
gnuwolf
06/17/2019, 10:30 AMarrMatrixItems isArray: true
arrMatrixItems typeof: object
gnuwolf
06/17/2019, 10:31 AM{
"type": "error.SuiteScriptError",
"name": "INVALID_FLD_VALUE",
"message": "You have entered an Invalid Field Value 43546\u000541957\u000540175\u000540174 for the following field: custrecord_fb_ed_from_item",
"stack": [
"anonymous(N/serverRecordService)",
"onRequest(/SuiteScripts/devg scripts/fb_sl_custom_item_email.js:330)"
],
"cause": {
"type": "internal error",
"code": "INVALID_FLD_VALUE",
"details": "You have entered an Invalid Field Value 43546\u000541957\u000540175\u000540174 for the following field: custrecord_fb_ed_from_item",
"userEvent": null,
"stackTrace": [
"anonymous(N/serverRecordService)",
"onRequest(/SuiteScripts/devg scripts/fb_sl_custom_item_email.js:330)"
],
"notifyOff": false
},
"id": "",
"notifyOff": false,
"userFacing": false
}
battk
06/17/2019, 10:34 AM