Greetings - I'm working through a Suitelet that's ...
# suitescript
c
Greetings - I'm working through a Suitelet that's transforming a Work Order to an Assembly Build. I keep getting an error
INVALID_FLD_VALUE
that appears to be related to the componentinventorydetail bin field on some line items. My script logs that it's setting the quantity and bin for every inventoryassignment sublist line known to man, but when I log out the record object right before saving, several component lines'
fulfillmentbin
fields are empty strings. This is the only field I can see in the record which isn't set. Has anyone got a clue as to why this might be happening? The items in question have plenty of inventory available in those bins, and everything is fully committed in the quantities we're attempting to consume. Thanks in advance!
b
share the error message, and potentially any code related to that message
c
error: 
Copy code
{
  "type": "error.SuiteScriptError",
  "name": "INVALID_FLD_VALUE",
  "message": "Field must contain a value.",
  "stack": [
    "Error\n at /SuiteScripts/Features/Pick Record/cxa001_sl_ez_assemblyBuildToWorkOrder.js:1691:42"
  ],
  "cause": {
    "type": "internal error",
    "code": "INVALID_FLD_VALUE",
    "details": "Field must contain a value.",
    "userEvent": null,
    "stackTrace": [
      "Error\n at /SuiteScripts/Features/Pick Record/cxa001_sl_ez_assemblyBuildToWorkOrder.js:1691:42"
    ],
    "notifyOff": false
  },
  "id": "",
  "notifyOff": false,
  "userFacing": true
}
As far as the code, it's happening on
record.save()
. The record being saved is an Assembly Build having been created through
record.transform
in Standard mode.
b
guessing from the column number, you are using 2.1, switch to 2.0
c
Yes, this is in 2.1. Switching to 2.0 would be a significant refactoring considering the amount of code and ES6 syntax. What specifically about the difference between those APIs could be leading to this issue?
b
it would be the first thing i try, 2.1 is too new and just came out
you can try using babel if you have too much code
but you would probably best be served with recreating the error with the least amount of code
then trying that in 2.0
it would also be what you need to do if you have to submit a support case
c
Hmm I can take a look at that. I'm a little surprised (and also not at all surprised) to hear that Netsuite won't support 2.1, considering that it came out of beta with 2020.1
b
they do support it, but your support case will be slow moving if you give them your 1700 lines of code and say its causing errors
c
Oh, but of course! 😄 Thanks for your help