From bfb9027cebb61f9d7c4d7c4584ebfe8a3eefe17c Mon Sep 17 00:00:00 2001 From: Onat Buyukakkus <55088871+onbuyuka@users.noreply.github.com> Date: Wed, 24 Dec 2025 17:57:31 +0100 Subject: [PATCH] Auto-populate Unit of Measure when selecting Item on Shopify Order Lines --- .../Order handling/Pages/ShpfyOrderSubform.Page.al | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Apps/W1/Shopify/App/src/Order handling/Pages/ShpfyOrderSubform.Page.al b/src/Apps/W1/Shopify/App/src/Order handling/Pages/ShpfyOrderSubform.Page.al index 072c4e66a1..17360472d0 100644 --- a/src/Apps/W1/Shopify/App/src/Order handling/Pages/ShpfyOrderSubform.Page.al +++ b/src/Apps/W1/Shopify/App/src/Order handling/Pages/ShpfyOrderSubform.Page.al @@ -5,6 +5,8 @@ namespace Microsoft.Integration.Shopify; +using Microsoft.Inventory.Item; + /// /// Page Shpfy Order Subform (ID 30122). /// @@ -41,6 +43,17 @@ page 30122 "Shpfy Order Subform" ApplicationArea = All; ShowMandatory = true; ToolTip = 'Specifies the item number.'; + + trigger OnValidate() + var + Item: Record Item; + begin + if Item.Get(Rec."Item No.") then + if Item."Sales Unit of Measure" <> '' then + Rec."Unit of Measure Code" := Item."Sales Unit of Measure" + else + Rec."Unit of Measure Code" := Item."Base Unit of Measure"; + end; } field(UnitOfMeasureCode; Rec."Unit of Measure Code") {