anyone know how/if one can assign a new lot number...
# suitescript
s
anyone know how/if one can assign a new lot number on an
inventorydetails.inventoryassignment
sublist row? I can't see a clear way to replicate what you can do in the UI (e.g. you can type in any old lot number text you want along with expiration date and quantity) (i.e. purchase order, or item receipt, or salesorder/fulfillment - would be happy to see this on any transaction type)
e
I have done this before with setSubListText. (Record was transformed from a SO.)
Copy code
subRecord.setSublistText({
	sublistId: 'inventoryassignment',
	fieldId: 'issueinventorynumber',
	text: detail.lotNumber,
	line: lineIndex
});
b
wrong direction
issue inventory number is for when your inventory decreases
receipt inventory numbers is for when your inventory increases
its why you shouldnt be able to choose your own receiving lot on the sales order/fulfillment
but you should be able to do it on the item receipt
s
but set 'text' is the magic trick?
b
it wont hurt, but it does the same thing as setSublistValue for text fields
s
my understanding is the
issueinventorynumber
and
receiptinventorynumber
fields are select fields -> pointing to InventoryNumber records (which we can't create directly in script). Are we saying that field dynamically creates a new InventoryNumber if you set it with text instead of a numeric value (which is even more confusing since NS internal ids are text, as observed). I tried setting text but it didn't seem to stick. Basically I am not seeing a path to successfully set this stuff in SS2 on a new purchaseorder
b
your lots may be weird if they arent text
s
I was going by the records browser, which only shows
issueinventorynumber
but it is listed as a select field ?https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2020_1/script/record/inventorydetail.html
b
dont confuse issueinventorynumber for receiptinventorynumber
s
by that you mean
issue
ties to a InventoryNumber but
receipt
does not?
b
yes, though that should be what you see in the ui as well
s
it looks like in the UI, you enter text in the LOT field and behind the scenes it still creates an InventoryNumber record, populating the
inventorynumber
with the text provided
b
same thing happens in script as well with the receiptinventorynumber, though lot field isnt descriptive enough, both issueinventorynumber and receiptinventorynumber have the same label