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

Sales invoice report logic change

(0) ShareShare
ReportReport
Posted on by 133
Hi all,
 
Well I have a simple requirement, where I have to change the logic for /SalesPrice/ on sales invoice report.
So I have made those changes in the dp class of the report. I created COC for /populateSalesInvoiceTmp/ method.
But when I run the report, the debugger doesn't hit these methods - populateSalesInvoiceTmp, insertIntoSalesInvoiceTmp.
Since the table is a regular one, I think they have put some conditions before populating it everytime.
 
Anyone can suggest how I can populate the field with my data? In Dev as well as in production.
I don't want to remove/bypass any standard condition or anything, but I want my code to get executed too.
 
Please suggest some solution here. I need to know what I am missing as soon as possible.
 
Thanks,
Bhagyashree Dave
I have the same question (0)
  • Martin Dráb Profile Picture
    238,745 Most Valuable Professional on at
    You're asking in the general D365, but your question seems to be specifically about one app: Finance and Operations. Please use the Finance forum next time. Unfortunately this new site doesn't (yet) allow moderators to move threads.
     
    The fact that "t, the debugger doesn't hit these methods" may mean that you have a problem with debugging, rather then the methods aren't called.
     
    Can you show us your class, please?
  • Mohit Rampal Profile Picture
    12,565 Moderator on at
    Hi, As Martin mentioned there can be issue with debugger. Can you create CoC or pre event handler on insert method of SalesInvoiceTmp table, add your code and check if debugger hits or if your values are populated correctly.
  • Bhagyashree Dave Profile Picture
    133 on at
    Hi Martin and Mohit,
     
    I have moved this thread to the finance forum.
     
    So as per Mohit's suggestion I put debugger in insert of SalesInvoiceTmp. It is hitting.
    But in call stack, some useExistingReportData method is being executed. maybe that's why my code is not running, but I'm not sure.
     
    Here in the image is my code.
     
    Please suggest some solution.
     
  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at
    You can write your code in OnInserting event handler of SalesInvoiceTmp table or create extension class for that table and write code before next call in insert method.
     
    public void insert()
    {
       if (this.Qty > 0)
       {
          this.SalesPrice = this.LineAmount/this.Qty;
       }
       next insert();
    }
     

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... 545 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 408

#3
Adis Profile Picture

Adis 267 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans