So here is the scenario, I have a 1:N relationship between Opportunity entity and a custom entity called Split Percentage. Usually the owner of an opportunity is the 100% owner of the Revenue from the opportunity. In reality, you may have more than one sales person or owner of the opportunity.
To cater this I created a custom entity with a look up to Opportunity. There is a sub-grid that shows the associated view on the Opportunity form. There are 3 parts to it. For now I can do things with business rules and workflow:
- When a new Opportunity is created a new record is created in Split Percentage entity with the owner's name assigned 100 percent split and value of estimated revenue from an opportunity.
- If anyone wants to add a new sales person to this opportunity, they add it through the grid in Opportunity form. You add percentage of split this new sales person should have e.g. 10% and their estimated revenue will be calculated e.g. 10% of $1000 is $100 which is the value assigned to that record.
Now the third part is where I am stuck at, deducting the value assigned to the new sales person from the total revenue of the owner. In the example above the value of owner should change from $1000 to $900.
I am not sure how to update the Estimated Revenue of the owner every time a new sales person is added to the Opportunity.