web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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)
  • 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();
    }
     
  • 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.
     
  • 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.
  • Martin Dráb Profile Picture
    238,308 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?

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

News and Announcements

Season of Giving Solutions is Here!

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
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 338 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans