RESOLVED: Hi, Does anyone tried to create the Inve...
# suitescript
j
RESOLVED: Hi, Does anyone tried to create the Inventory Worksheet transaction using Suitescript? I have found the issue when I try to set the new quantity to 0 and the new value to 0. The script will return this error:
Copy code
{
   type: "error.SuiteScriptError",
   name: "INVALID_FLD_VALUE",
   message: "Value Infinity outside of valid min/max range for field invtnewunitcost",
   id: "",
   stack: [
      "Error\n    at RecordInvoker.setCurrentSublistValue (suitescript/resources/javascript/record/serverRecordService.js:411:5)\n    at NetSuiteObject.thenableFunction() (suitescript/resources/javascript/record/proxy.js:115:24)\n    at createINVWorksheet (/SuiteScripts/Staria/Inventory Worksheet/entry_points/mr/sta_mr_snt_create_inv_worksheet.js:182:26)\n    at Object.reduce (/SuiteScripts/Staria/Inventory Worksheet/entry_points/mr/sta_mr_snt_create_inv_worksheet.js:98:30)"   ],   cause: {
      type: "internal error",
      code: "INVALID_FLD_VALUE",
      details: "Value Infinity outside of valid min/max range for field invtnewunitcost",
      userEvent: null,
      stackTrace: [
         "Error\n    at RecordInvoker.setCurrentSublistValue (suitescript/resources/javascript/record/serverRecordService.js:411:5)\n    at NetSuiteObject.thenableFunction() (suitescript/resources/javascript/record/proxy.js:115:24)\n    at createINVWorksheet (/SuiteScripts/Staria/Inventory Worksheet/entry_points/mr/sta_mr_snt_create_inv_worksheet.js:182:26)\n    at Object.reduce (/SuiteScripts/Staria/Inventory Worksheet/entry_points/mr/sta_mr_snt_create_inv_worksheet.js:98:30)"
      ],
      notifyOff: false
   },
   notifyOff: false,
   userFacing: true
}
I can create the transaction when I set the new quantity and new value as a positive number. That works correct. I am using the standard form and the field invtnewunitcost is not displayed there. I also try to set the invtnewunitcost to 0, null or '', but without any luck. I tried this using UI and the Inventory Worksheet can be created with a new quantity and new value both 0. Thanks in advance for any tips. -------------------------------------------- I added the ignoreFieldChange to
Copy code
recInvWS.setCurrentSublistValue({sublistId: 'invt', fieldId: 'invtnewqty', value: flNewValue, ignoreFieldChange : true})
and this helped the issue.