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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Set active record for query based report

(0) ShareShare
ReportReport
Posted on by 1,187

I made a query based report n which the report should run for selected record only  like P.O. confirmation report or invoice report..

Please suggest solution .

Regards

Nakul

*This post is locked for comments

I have the same question (0)
  • dolee Profile Picture
    11,279 on at

    Hi Nakul,

    Seems impossible. You'd probably need to use RDP instead of AOT query as datasource.

    Regards,

    Dominic Lee

  • Verified answer
    Denis Macchinetti Profile Picture
    16,444 on at

    Hi Nakul

    If a report have a query as datasource, you can override the method prePromptModifyContract of the controller class and handle the selected record like :

       SalesTable                       salesTable;

       QueryBuildDataSource    qbdsTable;

       salesTable = this.parmArgs().record() as SalesTable;

       if (salesTable)

       {

           qbdsTable = this.getFirstQuery().dataSourceTable(tableNum(SalesTable));

           qbdsTable.clearRanges();

           SysQuery::findOrCreateRange(qbdsTable, fieldNum(SalesTable, SalesId)).value(queryValue(salesTable.SalesId));

       }

    You can also condition the "showQuerySelectButton" method as well.

    You can return false if you have a selected record to avoid that user can changed the query.

    Obviously, when you click the Output button compare a dialog form where you can set the print destination.

    That's it!

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

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans