How do we know which unit of measure is in an item...
# ask-stanley-ai
a
How do we know which unit of measure is in an item.inventorydetail object when iterating over item with the list tag in Advanced PDF Templates?
c
AI generated answer (using internal Slack threads):
To determine the unit of measure in an
item.inventorydetail
object when iterating over an item with the list tag in Advanced PDF Templates, you would typically access the
units
field of the
item
object. However, it's important to note that the way this field is retrieved can vary depending on the method used to generate the PDF. In the context of Advanced PDF, if the "units" sublist field is not set to "show", the Advanced PDF interpreter fetches the text value of the unit. This means that you would see the actual unit of measure (e.g., "pieces", "boxes", etc.) when accessing
${item.units}
in your template. Here's an example of how you might iterate over the items and access the units in an Advanced PDF Template:
Copy code
code
<#list record.item as item>
    Item: ${item.item}
    Unit of Measure: ${item.units}
</#list>
In this example,
record.item
represents the list of items you're iterating over, and
item.units
gives you the unit of measure for each item. Remember, this behavior is specific to Advanced PDF and may differ if you're using other methods to generate your PDFs, such as the
N/render
module in SuiteScript. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.81636411
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.807452202
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.804920435
Please provide your feedback on this answer.