How to get the item UUID within a Custom Theme?

Hi,

In a sales-invoice-view tab is it possible to get the UUID of the items in the current invoice? I tried matching bt item name with inventory-item-batch but I think the UUID will be more robust for lookups.

No, the sales-invoice-view is only for printing, so item UUIDs are not available there.

If you need UUIDs for reliable lookups, you must access them via the API, for example:
Code

GET /api2/sales-invoice-form/{key}

This endpoint will return each line with its item.key (UUID).

Thanks, I see what you mean. Since I need this for a custom theme I have to somehow get the key of those items that are in current view. So how can we get the {key} for the current invoice view to make the GET request ?

My previous answer was wrong. The `/api4/view-v1` endpoint does **not** provide an invoice key, and there is no way to retrieve the raw invoice data from Custom Themes.