im doing a UE script on the item receipts created ...
# ask-stanley-ai
m
im doing a UE script on the item receipts created from inbound shipments need to get in the script the items of the landed cost sublist related to the inbound shipment in order of doing so I can fully access the sublist landed cost on the inbound shipment the issue is that at that point I can access the field landedcostshipmentitems that is a specific id on the inbound shipment I need to get the item id instead of landedcostshipmentitems how can I do so?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems you are trying to access the item id from the landed cost sublist of an inbound shipment in a User Event (UE) script. To achieve this, you need to load the inbound shipment record and then access the sublist. Here is a sample code snippet:
Copy code
javascript
var inboundShipment = record.load({
    type: 'inboundshipment',
    id: inboundShipmentId
});

var lineCount = inboundShipment.getLineCount({
    sublistId: 'items'
});

for (var i = 0; i < lineCount; i++) {
    var itemId = inboundShipment.getSublistValue({
        sublistId: 'items',
        fieldId: 'item',
        line: i
    });
    // Do something with itemId
}
In this code,
inboundShipmentId
is the id of the inbound shipment record you are working with. The
getSublistValue
function is used to get the value of the 'item' field from each line of the 'items' sublist. Please note that the sublistId 'items' is specific to the inbound shipment record type. In other record types, the sublist might be named 'item' instead. ****** 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.84865725
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837797761
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835909784
Please provide your feedback on this answer.