Classes used while calculating Commission

I am working on commission in sales and marketing module. I have done all the setups of commission.Then create a new sales order with the defined customer group on the customer and sales group on sales order.

After invoice, I can see the calculated commission in invoice journal.

I want to know the class which is calculating this commission Or how commissionTrans Table is getting data.

I have searched a class commission in AOT which I think has the code to calculate this commission but may be this class is not using as I have commented the code and create a new sales order and it is still calculating.

Why don’t you simply walk through the code dynamically in the debugger?

Thank for your quick reply Martin,

I have put breakpoint in salesFormLetter_Invoice and SalesFormLetter class but didnt find any method for calculating Commission and also put breakpoint in Commission Class which have method for calculating commission but it is not calling.

Hi Anant,

I also had the same problem. But didnt find any solution yet.

If anyone knows please reply.

Classes involved are: commission, commission_sales

Check & debug the Run method in commission class.

Start from the places you know, e.g. the table. You can, for example, put a breakpoint to the insert() method. You can also use cross references for static analysis.

Thanks for your quick reply,

As I have mentioned that i have already tried to debug Commission and commission_Sales class. But It is not calling. I have put breakpoint in Run method of that class also commented that code but it is still calculating.

Hello Martin,

I also tried the breakpoints in insert, update and Validate field methods of CommissionTrans Table but haven’t found solution.

Maybe you have a problem with debugging. If some code runs on AOS and you haven’t enabled server-side debugging, it won’t work. Also, if you use AX 2012, the code may actually run in CIL - you either have to use a CIL debugger (= Visual Studio) or to disable “Execute business operations in CIL” (Developer workspace > Tools > Options > Development tab).

Thank u for your support Martin. The work is done.