web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Update "Production BOM Line" table/page with existing field from another table

(6) ShareShare
ReportReport
Posted on by 19
Hi, 
 
I have spent close to 20 hours trying to solve what I thought would be 5 seconds of coding, alas I have had little success. I have read tutorials, Microsoft guidance, YouTube videos, etc. and still not figured out how to do this and am at whits end. 
 
GOAL: I want to use my scanner to scan a QR code to input Items into the Production BOM (specifically Lines) area. Essentially, if I select the ItemNo, I want the ItemReferenceNo to be populated (along with description), and vice-versa, if I scan a QR code (corresponding to an item) I want the ItemNo and Description to be populated - the purposes is to, rather than using a keyboard, be able to use my scanner to input items. I plan to replicate this in other areas as well, but...one project at a time. There are no issues with the scanning itself, which works properly on certain other pages. 
 
CURRENTLY: I have created a column /ItemReferenceNo/ that corresponds to an Item's Reference Number (Barcode) in a TableExtension object. This table extends /Production BOM Line/. The field properly shows (created simple PageExtension as well which seems to work fine) on the Page and Table. HOWEVER, the Item Reference Number is NOT being input when the Item Number is entered. On the opposite, if I input the Item Reference Number by scanning, the Item Description and Item Number fields will not populate. Below excerpts are the relevant code I've used. 
 
Apologies, apparently the forum is not allowing me to post photos. I am including the Code excerpt below. 
 
Attch 1: TableExtension 50104 extends /Production BOM Line/ [Tbl 99000772]
//
tableextension 50104 BOMTableExtension extends /Production BOM Line/
{
fields
{
field(50104; ItemReferenceNo; Code[50])
{
Caption = 'Item Reference No';
DataClassification = CustomerContent;
TableRelation = IF (Type = const(Item)) /Item Reference/./Reference No./;
trigger OnValidate()
var
Item : Record Item;
ItemReference : Record /Item Reference/;
begin
ItemReference.Get(ItemReferenceNo);
/No./ := ItemReference./Item No./;
Description := Item.Description;
end;
}
modify(/No./)
{
trigger OnAfterValidate()
var
ItemRef : Record /Item Reference/;
begin
ItemReferenceNo := ItemRef./Reference No./
end;
}
 
 
Attch 2: PageExtension 50104 extends /Production BOM Line/ [ListPart 99000788]
 
pageextension 50104 PageExtension50104 extends /Production BOM Lines/
{
layout
{
addafter(/No./)
{
field(ItemReferenceNo; Rec.ItemReferenceNo)
{
ApplicationArea = All;
Editable = true;
}
}
}
}
I have the same question (0)
  • Suggested answer
    NAV_with_Narang Profile Picture
    2,380 Moderator on at
    Hi, instead of modify(/No./), have you tried writing your code under a subscriber for the field's OnAfterValidate?
     
    Plus under modify(/No./) you have not fetched or used GET/SETRANGE for ItemRef, its just a variable, does not fetch data from the table trigger
     
    OnAfterValidate() var ItemRef : Record /Item Reference/; begin ItemReferenceNo := ItemRef./Reference No./
  • Suggested answer
    OussamaSabbouh Profile Picture
    16,699 Super User 2026 Season 1 on at
    Hello,
     
    Use FIND and VALIDATE properly:
    When scanning the Item Reference, find the related record and VALIDATE("No.") to fill fields.
    When entering Item No., find its reference and update ItemReferenceNo.
    This syncs both fields for barcode scanning.
     
    Regards,
    Oussama Sabbouh

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,216 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,471 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,369

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans