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 :
Microsoft Dynamics NAV (Archived)

Passing the page parameters(PRIMARY KEY) to filter the report as per the passed PRIMARY KEY

(0) ShareShare
ReportReport
Posted on by

After adding the parameter on the OnAction using the following Code

Report Invoice - OnAction()
RunReport(REPORT::"Report Invoice","No.");

How to filter the Report based upon the "No." feild ?

*This post is locked for comments

  • Verified answer
    Tina Menezes Profile Picture
    2,582 on at

    Hi,

    You can declare a global variable say 'RecordName' with type as Record and select the subtype as the Record ID eg if your table is customer it will be customer table record.

    In your on action write the following code:

    Report Invoice - OnAction()

    RecordName := Rec;

    RecordName.SETRANGE("No.",RecordName."No.");

    REPORT.RUNMODAL(50010,TRUE,TRUE,RecordName);

    Here 50010 will be your report ID which should run on clicking the action.

  • ManishS Profile Picture
    86 on at

    Filter upon No. field ?

    Can you please explain in more detail.

  • Verified answer
    Binesh Profile Picture
    7,887 on at

    Hello,

    you have a value in your field i.e. "No."
    so you can filter your record somthing like:
    TableVariable.GET("No.");
    REPORT.RUNMODAL(REPORT::"Report Invoice",FALSE,FALSE,TableVariable);

    Note: Here, first parameter is Report ID, 2nd Parameter is RequestPage
    3rd Parameter is System Printer, and 4th parameter is which record you want to print in your report.

    Note 2: you are using this action in page and if your page source table is same as Report DataItem then you can directly
    write this code in your OnAction
    REPORT.RUNMODAL(REPORT::"Report Invoice",FALSE,FALSE,Rec);

  • Jalmaraz Profile Picture
    669 on at

    You must pass a filtered record this way:

    Record."No." = "No."

    Record.SETRECFILTER;

    Report.RUNMODAL(REPORT::"Report Invoice",True,FALSE,Record);

    Edited: already answered above, please forgive me, and ignore this post.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans