Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

AL problem.

(1) ShareShare
ReportReport
Posted on by 123
Hello Everyone!
I hope you are doing well. 
Does anyone know why 'No.' cannot be recognized by my code? In  table sales line, No. is the name of the field for Item No. 
pageextension 50124 "Sales Order Subform Ext" extends "Sales Order Subform"
{
    layout
    {
        addafter("Description")
        {
            // This field is on Sales Line (from my "Sales Line Ext")
            field("Four Digit"; Rec."Four Digit")
            {
                ApplicationArea = All;

                trigger OnValidate()
                var
                    itemRef: Record "Item Reference";
                begin
                    // Filter Item Reference by the same 4-digit code
                    itemRef.SetFilter("Four Digit", Rec."Four Digit");
                    if itemRef.FindFirst() then
                        "No." := itemRef."Item No."
                    else
                        Error('No matching reference for "%1".', Rec."Four Digit");
                end;
            }
        }
    }
}
 
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 10,694 Super User 2024 Season 2 on at
    AL problem.
     
    You need to add Rec. Before No.
    Rec."No." := itemRef."Item No."
    Best regards,
    Mohamed Amine MAHMOUDI

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans