Skip to main content

Posts

Create Transfer Order Line by Scanning Barcode in Dynamics 365 Finance & Operations X++

Create Lines By Scanning Barcode on Transfer Order / Sales Order / Purchase Order Forms When working with  Transfer Order / Sales Order / Purchase Order  in Dynamics 365 F&O, the standard behavior requires the user to manually select the Item ID every time they add a new line. But in many warehouses, users simply want to scan the barcode and automatically have the related item appear on the line — saving time and reducing manual errors. Recently, I implemented this exact requirement : When a user scans the item barcode on the Transfer Order line, the system should automatically fetch the Item ID linked with that barcode and populate the line. To achieve this, I created a custom barcode field on the InventTransferLine table named MZNFRItemBarCode , and then added logic to validate the barcode and populate the ItemId automatically. Below is the code I used. X++ Code — Auto Populate Item ID By Scanning Barcode [ExtensionOf(tableStr(InventTransferLine))] final clas...