how can I get lot number quantity on the packing l...
# general
c
how can I get lot number quantity on the packing list? I found this and it gets the lot number, but not the quantity. item.inventorydetail will get the lot number, quantity, and bin, but I struggle in algorithmic thinking to get the quantity.
a
I don't know the answer myself, but we do need to develop your question a little more: Are you trying to access the inventory detail of a transaction line item, via a Search, a Formula, in a Suitescript, or what?
c
inventory detail of a transaction line (fulfillment), in advanced PDF without new custom fields, to pass that into a barcode
a
Correct me if I'm wrong but are you saying you want to display the inventory detail quantity as a barcode? You mentioned wanting to pass the inventory detail into a barcode, and mentioned wanting to get the quantity from the inventory detail. I hope I'm understanding you correctly. With that assumption in mind, I found a reddit post that makes me think that item.inventorydetail gets all 3 of lot number, quantity, and bin, as one string? I haven't used that member of the item object from list.item as item iteration yet, so I'm just trying to find out about it from this post: https://www.reddit.com/r/Netsuite/comments/m7axlt/advanced_pdf_inventory_detail_on_packing_slip/ If it turns out that it actually works this way, and quantity is one of the pieces of data in a string stored as item.inventorydetail, you can select from part of the string or a split sequence of it, then convert it to a number if needed. I'm not sure if it shows the quantity in Eaches or if it does the line item's selected units of measure. I've never done item.inventorydetail before. Here's another useful page but you probably already read it before coming here: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N2864199.html#subsect_163585869493
🙏 1
Did that help at all?
👍 1
c
Yes it did, it was still a bit beyond my tech abilities
a
I'm not sure if it's telling the right syntax or code, but I asked Stanley AI how to do it, since I don't currently have time to make a working example myself: Aaron McCausland [11:21 AM] In Freemarker for advanced pdf/html templates, how can we get just the Quantity of an Inventory Detail part of an item in an iteration over record.items? Assuming item.inventorydetail contains a string with three substrings separated by spaces, for the lot number, quantity, and one other thing, then how do we get just the quantity? 4 replies Celigo AI [11:21 AM]
AI generated answer (using internal Slack threads):
In Freemarker for advanced pdf/html templates, to get just the Quantity of an Inventory Detail part of an item in an iteration over record.items, you would need to split the string in
item.inventorydetail
and extract the quantity part. Assuming
item.inventorydetail
contains a string with three substrings separated by spaces, for the lot number, quantity, and one other thing, you can use the
?split
built-in function in Freemarker to split the string into a sequence (array) of strings. Here is an example of how you can do it:
Copy code
freemarker
<#assign inventoryDetails = item.inventorydetail?split(" ")>
<#assign quantity = inventoryDetails[1]>
In this example,
inventoryDetails
is an array of strings obtained by splitting
item.inventorydetail
by space.
quantity
is the second element in the array (Freemarker array indices start at 0), which should be the quantity according to your description. Please note that this assumes that the quantity is always the second substring in
item.inventorydetail
. If the order can vary, you would need a more complex logic to identify the quantity. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.