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 :
Finance | Project Operations, Human Resources, ...
Answered

Method this.getFirstQuery() doesn't work

(1) ShareShare
ReportReport
Posted on by 460
Hi All,
 
I created a SSRS report which type is query and created a controller which is used by menu item(action) to run the SSRS report.
But I got the failture message as below when the class was run. Then I debugged the class source codes and noticed that variable query was null. I think this is the reason why the SSRS report couldn't be created. It seems that the method this.getFirstQuery() doesn't work.
Could you help me get this method work and figure the issue out?
 
Thanks in advanced.
My source code is as below.  I think it's normal and standard.
 
------------------------------------------------
class ww_RDLCustTransController extends SrsReportRunController 
{
    public static void main(Args args)
    {
        ww_RDLCustTransController controller = new ww_RDLCustTransController();
        controller.parmReportName(ssrsReportStr(ww_RDLCustomTransReport, Report));
        controller.parmArgs(args);
        controller.startOperation();
    }
 
    protected void prePromptModifyContract()
    {
        //super();
        Query                   query;
        QueryBuildDataSource    qbds;
        CustTable             custTable;
        
        custTable = args ? args.record() as CustTable : null;
        if (custTable.RecId)
        {
            query = this.getFirstQuery();
            qbds = query.dataSourceTable(tableNum(CustTable));
            qbds.addRange(fieldnum(CustTable, AccountNum)).value(custTable.AccountNum);
        }

    }
}
 
I have the same question (0)
  • Verified answer
    GirishS Profile Picture
    27,833 Moderator on at
    Hi Jacky Quian,
     
    Refer to the standard class "BankDepositSlipController" class - Inside the "prePromptModifyContract" method see how they are getting the query and adding the range.
    Report name is "BankDepositSlip".
    Also please refer to the below blog and see if it helps.
     
    Thanks,
    Girish S.
  • Verified answer
    Jacky Qian Profile Picture
    460 on at
    Hi Girish S.
     
    Thanks for your help.
     
    As the below URL blog described, I practiced to solve the issue and found the root cause was the property Dynamic Filters of a dataset in the report was set up to False in Visual studio. 
    I changed it to True, then the issue was sovled. Anyway, if the value of property Dynamic Filters is False, the result of the following statement is also null. Because the result of  parmQueryContracts()  is null.

     this.parmReportContract().parmQueryContracts().lookup(this.getFirstQueryContractKey())

     
     
     
    Thank you so much

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 514 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 390

#3
Adis Profile Picture

Adis 266 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans