Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Purchase Sub Form 54

Posted on by 3,027

Hi

 I have written the below code . I want to know how these lines function

1. No. - OnLookup(VAR Text : Text) : Boolean

2. IF PAGE.RUNMODAL(0, ItemRec) = ACTION::LookupOK THEN

3. What is Rec,xRec in C/Al Symbol Menu

PHRec is Purchase Header Record SubType

No. - OnLookup(VAR Text : Text) : Boolean
PHRec.RESET;
PHRec.SETRANGE("No.", "Document No.");
IF PHRec.FINDFIRST THEN;

ItemRec.RESET;
ItemRec.SETRANGE("Vendor No.", PHRec."Buy-from Vendor No.");
IF PAGE.RUNMODAL(0, ItemRec) = ACTION::LookupOK THEN

Text := ItemRec."No.";

Thanks

*This post is locked for comments

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Purchase Sub Form 54

    The first is the OnLookup trigger for No field. This is the event triggered when you click on that field.

    The second is the C/AL instruction for opening the default lookup page for a table.

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: Purchase Sub Form 54

    Hi

      Thanks. What does the below 2 lines do

    1. No. - OnLookup(VAR Text : Text) : Boolean

    2. IF PAGE.RUNMODAL(0, ItemRec) = ACTION::LookupOK THEN

    Thanks

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Purchase Sub Form 54

    Rec contains the current record, xRec contains the previous version of the current record (before updates or field changments).

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans