Skip to main content

Notifications

Announcements

No record found.

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);
        }

    }
}
 
  • Verified answer
    Jacky Qian Profile Picture
    460 on at
    Method this.getFirstQuery() doesn't work
    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
  • Verified answer
    GirishS Profile Picture
    27,823 Moderator on at
    Method this.getFirstQuery() doesn't work
    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.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,892 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,772 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans