Hello, it's me again, bothering you:sweat_smile:. ...
# suitescript
a
Hello, it's me again, bothering you😅. This is my code. I'm trying to assign a lot to a sales order fulfillment via script. I'm working on doing it massively. However, when trying to save it, it initially told me that I needed to create the inventory detail for line 1. But now, when I do that, it tells me that I'm missing assigning the lot/number and the status. I've added more code and now it tells me that the value 1 is incorrect for the status. Does anyone know why? I'm attaching the code for review, thank you very much. el error es: {"type":"error.SuiteScriptError","name":"INVALID_FLD_VALUE","message":"You have entered an Invalid Field Value 1 for the following field: inventorystatus","id":"","stack":["Error\n at RecordInvoker.save (suitescript/resources/javascript/record/serverRecordService.js37113)\n at NetSuiteObject.thenableFunction() (suitescript/resources/javascript/record/proxy.js11524)\n at /SuiteScripts/ REMISIONES MASIVAS/SS_asigna_masiva_lotes_remision.js17463\n at Array.forEach (native)\n at Object.onRequest (/SuiteScripts/ REMISIONES MASIVAS/SS_asigna_masiva_lotes_remision.js5329)"],"cause":{"type":"internal error","code":"INVALID_FLD_VALUE","details":"You have entered an Invalid Field Value En stock for the following field: inventorystatus","userEvent":null,"stackTrace":["Error\n at RecordInvoker.save (suitescript/resources/javascript/record/serverRecordService.js37113)\n at NetSuiteObject.thenableFunction() (suitescript/resources/javascript/record/proxy.js11524)\n at /SuiteScripts/REMISIONES MASIVAS/SS_asigna_masiva_lotes_remision.js17463\n at Array.forEach (native)\n at Object.onRequest (/SuiteScripts/REMISIONES MASIVAS/SS_asigna_masiva_lotes_remision.js5329)"],"notifyOff":false},"notifyOff":false,"userFacing":true}
a
A couple of years ago I was unable to write code to assign inventory details to a line when using inventory status, it was not scriptable or NetSuite had a bug. I’m not 100% sure if this is still the case. Maybe someone else knows better. @battk Any ideas? I do remember that Inventory Details using inventory status did not worked out for me.
b
you can set inventory status in suitescript, usual rules, as long as its a valid select option for the item
my personal guess is that this isnt an attempt at recreating a valid fulfillment, there are too many guesses on which fields to set
which means you get the usual advice, make the fulfillment in the ui first, inspect which fields are set with which values, and then recreate it in script