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 AX (Archived)

Set active record for query based report

(0) ShareShare
ReportReport
Posted on by 1,185

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

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans