function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Steven MSteven M 

Roll up summary not working with formula field in Opportunity environment

Hello,

 

We sell products to accounts who each may have different commissions. In the opportunity products environment for different type of products, I have created a simple formula that looks up the commission depending on the product family and the account. The problem is, SF does not allow for roll up sums on "cross object formulas" which is silly but I can't change that today. My question is, Does anyone know of a workaround to have a roll up summary of commission on the opportunity level?

 

Thanks!

 

Steven

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

To get this level of detail, you'll need Apex Code. There are plenty of starving developers out there that will do this for virtually no cost, or you can try your own hand at it (it really is not as hard as it looks at first blush). After your code is in place, you'll have to then run a data loader against the affected records to have their amounts updated. Please note that this functionality does not work because of the complexities of rolling up these values (i.e. if object B references object A, and rolls up to object C, then A would have to trigger B's triggers so that C can be updated correctly; this logic does not currently exist in the platform). This is similar to why you have to be careful rolling up formulas that have dynamic values over time, because they can not be rolled up (rollup actions do not occur in batch, but instead only when a record is edited). You'll have to take these considerations into account when you build your Apex Code/Triggers to do this custom logic.

All Answers

sfdcfoxsfdcfox

To get this level of detail, you'll need Apex Code. There are plenty of starving developers out there that will do this for virtually no cost, or you can try your own hand at it (it really is not as hard as it looks at first blush). After your code is in place, you'll have to then run a data loader against the affected records to have their amounts updated. Please note that this functionality does not work because of the complexities of rolling up these values (i.e. if object B references object A, and rolls up to object C, then A would have to trigger B's triggers so that C can be updated correctly; this logic does not currently exist in the platform). This is similar to why you have to be careful rolling up formulas that have dynamic values over time, because they can not be rolled up (rollup actions do not occur in batch, but instead only when a record is edited). You'll have to take these considerations into account when you build your Apex Code/Triggers to do this custom logic.

This was selected as the best answer
mdavis.ax765mdavis.ax765

My company, Xactly, produces a native force.com app to handle all different kinds of commission structures...we manage the APEX code so you don't have to and provide a "click to code" approach to sales comp in Salesforce.

 

http://www.xactlycorp.com/sales-commission-software/express/

 

-Mike D