Hi There,
I try to override the recalculate behavior of CRM sales orders because I've added custom discount fields in both salesorder and salesorderdetail. This is what I've done already:
- Create a pre-processing plugin on create/update of salesorderdetail which recalculates the salesorderdetail fields
- Create a pre-processing plugin on update of salesorder which recalculates the salesorder fields. Here I also perform a lookup for related salesorderdetail records to get the required values, but I do not update those salesorderdetail records.
I'm already working on this for a week and cannot find a solution that works.
For some reason I have an infinite loop because the Depth parameter increases until 8 and then it throws an exception. Next to that, CRM seems to overwrite my calculation....
Can someone PLEASE explain to me how I can get this working?