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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Unable to show the PO No.

(0) ShareShare
ReportReport
Posted on by 1,893

Vendor Ledger Entry - OnAfterGetRecord()

I want to print the Purchase Order No. which is saved in purchase receipt header.

My code is below.

PurchInvLine.RESET;
PurchInvLine.SETRANGE("Document No.",PurchInvHeader."No.");
PurchInvLine.SETRANGE("Receipt Document No.",PurchRcptHeader."No.");
IF PurchInvLine.FIND('-') THEN BEGIN
PurchRcptHeader.RESET;
PurchRcptHeader.SETRANGE("Order No.", PurchInvHeader."Order No.");
IF PurchRcptHeader.FIND('-') THEN BEGIN
PONo:= PurchRcptHeader."Order No.";
END;
END;

My code is not working to get the PO No. information.

Here have three table,
Purch. Inv. Header
Purch. Rcpt. Header
Purch. Inv. Line

Receipt Document No. is a MRN no from "Purch. Rcpt. Header". ORDER No. is field in "Purch. Rcpt. Header" table, which have PO No.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at

    PurchInvLine.SETRANGE("Receipt Document No.",PurchRcptHeader."No.");

    you are getting PurchRcptHeader below and does this field has values here?

  • manish.yadav Profile Picture
    1,893 on at

    My data item is "Vendor Ledger Entry" that's a reason i am facing the problem to find the PO no from PurchRcptHeader .

    Through my code:

    Vendor Ledger Entry - OnAfterGetRecord()

    I have find the many values, but unable to find the PO no. from PurchRcptHeader.

    recVend.RESET;

    recVend.SETRANGE("No.","Vendor Ledger Entry"."Vendor No.");

    IF recVend.FIND('-') THEN BEGIN

      txtvendname := recVend.Name;  

    END;

    PurchInvHeader.RESET;

    PurchInvHeader.SETRANGE("No.","Vendor Ledger Entry"."Document No.");

    IF PurchInvHeader.FIND('-') THEN BEGIN

       txtPONo := PurchInvHeader."Order No.";

       txtPayTerms:=PurchInvHeader."Payment Terms Code";

    END;

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans