I am getting `{"type":"error.SuiteScriptError","na...
# suitescript
r
I am getting
{"type":"error.SuiteScriptError","name":"SSS_INVALID_SRCH_COL","message":"An nlobjSearchColumn contains an invalid column, or is not in proper syntax: quantityonhand."
, when triggering a search of type
search.Type.INVENTORY_BALANCE.
I aim to get the quantity on hand for a given item and location. I believe the internal ID is
quantityonhand
, but I haven't found the documentation on this so I am not fully sure. I have also try with same result with
quantityavailable
and
totalquantityonhand
. Any idea? I normally run the searches in the UI and export it with the plug-in _NetSuite Saved Search Code Expor_t and this way I have no issue with internal ids of columns, but inventory balance searches are not supported in the plug-in.
b
learn to inspect the filter expression manually
load the search in code and log the filter expression
r
Ups great idea, I forgot I could load the search. Thank you. I am going to check that.
It was "onhand". Is this the only method to figure this out? I expected it to be on the records browser, but I did not see it so far. Thanks again for the suggestion
b
make a formula column, choose your field in the field select and use whatever id it output
d
@Roc127 if you open up to create a new Inventory Balance search in the UI, you can run the following snippet in the browser console:
Copy code
jQuery('.ns-dropdown[data-name="alertbodyfield"]')
  .data('options')
  .filter(o => o.value && !o.value.startsWith('_'))
(this will work on any other search type as well)
👍 1
r
@dbarnett thank you very much! This is very useful and I was not aware of it
156 Views