Castor
01/14/2025, 12:05 AMAaron McCausland
01/14/2025, 3:58 PMCastor
01/14/2025, 4:55 PMAaron McCausland
01/15/2025, 8:09 PMAaron McCausland
01/17/2025, 5:15 PMCastor
01/17/2025, 5:19 PMAaron McCausland
01/17/2025, 5:25 PMAI 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:
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.