How can I access the serial number of inventory de...
# ask-stanley-ai
s
How can I access the serial number of inventory detail's serial item using freemarker's expression.
c
AI generated answer (using internal Slack threads):
To access the serial number of an inventory detail's serial item using Freemarker's expression, you would need to use the
getSublistValue
method to get the internal id of the serial number, and then perform a search or query to find the matching inventory number to get the text. Here is a general idea of how you might do this:
Copy code
javascript
var serialNumberInternalId = record.getSublistValue({
    sublistId: 'inventory',
    fieldId: 'serialnumbers',
    line: i
});

var serialNumberText = search.lookupFields({
    type: search.Type.INVENTORY_NUMBER,
    id: serialNumberInternalId,
    columns: ['inventorynumber']
}).inventorynumber;
Please note that this is a general idea and you might need to adjust the sublistId, fieldId, and line number according to your specific use case. ****** 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.835245609
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834108591
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830829918
Please provide your feedback on this answer.