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 :
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,827 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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans