Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

How to add Pay to /Bill to Name in a report

Posted on by 50

Hi

I need to add Pay to/Bill to Name in a report. The Bill to/Pay to No. comes from VAT entry table. How can I do that?

Thanks,

*This post is locked for comments

  • Aqidah Profile Picture
    Aqidah 10 on at
    RE: How to add Pay to /Bill to Name in a report

    can u teach me step by step?

  • SurendraMaurya Profile Picture
    SurendraMaurya 15 on at
    RE: How to add Pay to /Bill to Name in a report

    hello Sha212

    Please try this code

    VAT Entry - OnAfterGetRecord()
    CLEAR(PaytoBilltoName);
    IF "Bill-to/Pay-to No." = '' THEN
    CurrReport.SKIP;

    IF "VAT Entry".Type = "VAT Entry".Type::Sale THEN
    BEGIN
    CustomerRec.RESET;
    CustomerRec.SETRANGE("No.","Bill-to/Pay-to No.");
    IF CustomerRec.FINDFIRST THEN
    PaytoBilltoName:=CustomerRec.Name +' '+CustomerRec."Name 2";
    END ELSE
    IF "VAT Entry".Type = "VAT Entry".Type::Purchase THEN BEGIN
    VendorRec.RESET;
    VendorRec.SETRANGE("No.","Bill-to/Pay-to No.");
    IF VendorRec.FINDFIRST THEN
    PaytoBilltoName:=VendorRec.Name+' '+VendorRec."Name 2";
    END;

  • Suggested answer
    SurendraMaurya Profile Picture
    SurendraMaurya 15 on at
    RE: How to add Pay to /Bill to Name in a report

    Add this code

    VAT Entry - OnAfterGetRecord()

    CLEAR(PaytoBilltoName);

    IF "Bill-to/Pay-to No." = '' THEN

     CurrReport.SKIP;

    IF "VAT Entry".Type = "VAT Entry".Type::Sale THEN

     BEGIN

      CustomerRec.RESET;

       CustomerRec.SETRANGE("No.","Bill-to/Pay-to No.");

       IF CustomerRec.FINDFIRST THEN

         PaytoBilltoName:=CustomerRec.Name +' '+CustomerRec."Name 2";

        END ELSE

          IF "VAT Entry".Type = "VAT Entry".Type::Purchase THEN BEGIN

            VendorRec.RESET;

            VendorRec.SETRANGE("No.","Bill-to/Pay-to No.");

            IF VendorRec.FINDFIRST THEN

              PaytoBilltoName:=VendorRec.Name+' '+VendorRec."Name 2";

             END;

    ===============================================        

    And Difference way

    Add field PaytoBilltoName in VAT Entry Table

    and use as Normal field

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: How to add Pay to /Bill to Name in a report

    You need to add code to retrieve those in your report and add add to the dataset to use in the report.

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans