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

Override a DP class for customize an SSRS report

(1) ShareShare
ReportReport
Posted on by 501
I want to print the LedgerTransPerJournal report in d365fo. There's already a built in LedgerTransPerJournalDP class for it. But it print the posted ones.

What I want is to create a new button (already did), and print but unposted ones, how?
 
Means how can I change the DP condition or query in a way that prints the unposted ones.
I already created a code extension but I don't what are the next steps to proceed with.

I have the same question (0)
  • Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at
    I'm assuming your can manipulate the query in an CoC extension of buildQueryToProcessReport() method.
  • CU09091357-0 Profile Picture
    501 on at
    Martin Dráb thank you for your response, can you please give me an example how? Because I didn't find the buildQueryToProcessReport() method in AOT.
  • Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at
    If you don't have it in your application, writing an example of how to extend it would be a waste of time, because you couldn't use it.
     
    I'm looking into 10.0.41; what is your version? Mybe you've just made a mistake when looking for the method.
     
    Anyway, you can simply look into LedgerTransPerJournalDP.processReport() to see how the query is obtained in your application.
  • CU09091357-0 Profile Picture
    501 on at
    Martin Dráb yes I have it, but I didn't find anything related to the posted or not posted
     
     protected final Query buildQueryToProcessReport()
     {
         Query query = this.parmQuery();
         QueryBuildDataSource ds = query.dataSourceTable(tableNum(GeneralJournalEntry));
         QueryBuildRange range = SysQuery::findOrCreateRange(ds, fieldNum(GeneralJournalEntry, Ledger));
         range.value(SysQuery::value(Ledger::current()));
         if (this.parmDataContract().parmFromDate() != dateNull()
             && this.parmDataContract().parmToDate() != dateNull())
         {
             QueryBuildRange dateRange = SysQuery::findOrCreateRange(ds, fieldnum(GeneralJournalEntry, AccountingDate));
             dateRange.value(SysQuery::range(this.parmDataContract().parmFromDate(), this.parmDataContract().parmToDate()));
         }
         return query;
     }
     
  • Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at
    That's true, but it's not related to the problem. Still, this the the method that you can extend and where you can change the filter value. That the range was added somewhere else doesn't change anything.
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    The DP class is using "LedgerTransPerJournal" query. In the query, they are specifically joining LedgerJournalEntry with LedgerJournalTable. And from this LedgerJournalTable, they are specifically using PostedDateTime. I think, only after posting only we can make the above join since there is no other place where there is a range on Posted. So please check these joins so that you can understand if you need to recreate the report from scratch.
  • Suggested answer
    Sankar Ramalingam Profile Picture
    262 on at
    You can't do it with LedgerTransPerJournalDP because query "LedgerTransPerJournal" used has GeneralJournalEntry data source which will have only Posted transactions.
     
     
    I would recommend to duplicate LedgerTransPerJournalDP class with new query with LedgerJournalTable and LedgerJournalTrans. By doing this, you may need to duplicate the SSRS report as well to change the data source as well. I think this is the way you can proceed.
     
     
  • Verified answer
    Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at
    You could disable the data source in the query, so that's not a problem as such, but the code of LedgerTransPerJournalDP depends on it, therefore it would fail there. It seems that the overall idea of reusing this report is wrong indeed.

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
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans