Hi all, so I'm using an N/search script to find records with matching serial numbers. However, the filter is being removed because apparently the value of the serial number needs to be a number and not text which seems.. really dumb. Unfortunately it seems the filter I was using of inventorydetail.inventorynumber is for the id of the serial number on the list of serial numbers, and not the number itself. So I'm trying to get to inventorydetail.inventorynumber.inventorynumber but those are not valid joins.
Does anyone know how I can achieve this? I've attached my script for reference and pictures of the logs. For the script I'm focused just on the search aspect of it, trying to go through the serial numbers on the item receipt I'm saving and use those to search for matching sales orders.
The record browser suggests that inventorynumber is a select type that is joined to inventory detail. But I don't know how to get the inventorynumber out of the inventorynumber record.
https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2019_1/script/record/inventorydetail.html
Thanks!
Logs showing the script iterating through the line items, taking their serial numbers and then on each error, the filter is removed because it needs to be numeric.
Only just realizing now that the SO doesn't actually contain serial numbers, so I'll need to change it to the invoice. But I think the error will still persist.
___________________________________
I'm trying to log out what value might actually be returned in the search by inventorydetail.inventorynumber as an example. I'm trying to do this by filtering out all null vales
['inventorydetail.inventorynumber', 'noneof', '@NONE@']
but it's still returning null values. Is this wrong?
____________________________________
Reading from the records browser that inventorynumber has a lot of search filters, but I'm not sure how to write that into my search.
https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2019_1/script/record/inventorynumber.html
Would it be inventorydetail.inventorynumber.inventorynumber, or inventorynumber.inventorynumber? I'm doing trial and error at this point hoping one works.