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

Get current selected parameter in records to include query of vendor account statement

(0) ShareShare
ReportReport
Posted on by 95
Hello everyone,
 
I want to generate and send the vendor account statements to the selected vendor or vendor group specified in the 'Records to Include' parameter. While I understand that obtaining the RecId is possible in 'prePromptModifyContract' if the report is generated from a form, I am not sure about how to achieve the same in a standalone output report in controller class, particularly when dealing with the vendor or vendor group in the 'Records to Include' query . i want to get the parameter from contract class and records to include filter to generate and send the attachment  Please suggest a way i can achieve this
 
Regards,
I have the same question (0)
  • Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
    Hi,
     
    You can call the query in the DP class ( records to include).  On processReport method add the following code :
     
    Query query = this.parmQuery();
     
    QueryRun queryRun = new QueryRun(query);
    while (queryRun.next())
    {
    // assume Vendor table is Table 1 and vend group is Table2
    Table1 = queryRun.get(tableNum(Table1));
    Table2 = queryRun.get(tableNum(Table2));
    // insert in your temp table
    }
  • D365Explorer Profile Picture
    95 on at
    Hello Waed,
     
    I know how to get the query in DP. However, my goal is to send vendor account statements as emails to the selected vendors directly specified in the 'Records to Include' query or to the vendors belonging to the vendor group selected in the same query. For the email logic, I have created a separate class where I pass the vendor and contract class. Now, I want to call this class from my controller class extension and iterate through the vendors obtained from the 'Records to Include' query. I am facing difficulty in accessing the 'Records to Include' query in my controller class, I'm not sure how to do that
  • Suggested answer
    Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at
    You can call getFirstQuery() in the controller class.
  • Verified answer
    D365Explorer Profile Picture
    95 on at
    Hello Martin,
     
    Thankyou for the suggestion. I'm able to get the record now by using bellow snippet.
     
    protected void preRunModifyContract()
        {
            super();
    
            VendTable VendTablelcl;
            Query query;
            QueryRun queryRun;
            query = this.getFirstQuery();
            
            queryRun = new QueryRun(query);
            while (queryRun.next())
            {
                VendTablelcl = queryRun.get(tableNum(VendTable)) as VendTable;
            }
            
    
    
        }
     PS: I'm trying to mark Martin answer as verified but site keeps getting stuck on processing.

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