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
programmer4hireprogrammer4hire 

3 month product field

Compliance would like a field created on the Opportunity page that sums up the total sales price of the attached opportunity products. It should only sum up the products that dates within the past three months.  I was thinking CronKit might be able to do this, but just wanted to to see if there might be another solution.  Thanks.
Best Answer chosen by Admin (Salesforce Developers) 
programmer4hireprogrammer4hire

Eventually I came up with the following, based on one of the comments from this idea:

 

1. Created a second field on the Opportunity Product, Total Price 2
2. Created a Workflow Rule, Update Total Price 2, with a rule criteria that Opportunity Product has a Created Date that equals the last 90 days.  If this is true, it copies the Total Price to Total Price 2.
3. Created a Roll-Up Summary field, Three Month Total Sales Price, that sums on Total Price 2.

 

So far, testing is showing that it is working.

All Answers

werewolfwerewolf

Have you tried making a new Roll-up Summary field on Opportunity?  Perhaps what you can do is:

 

1.  Make a formula field on Opportunity Product that adds 90 days to TODAY()

2.  Set your RSF on Opportunity to sum all Opportunity Products where that formula field is less than TODAY

programmer4hireprogrammer4hire
I tried your solution but when I was setting up the RSF, I could not filter it by the formula field, so currently it just sums all the opportunity products.  Any suggestions?  Thanks.
werewolfwerewolf
Oh, of course, that was silly of me -- you can't filter on fields that contain TODAY because those fields change every day.  Do they really want the products in the last 3 months, or the products added in the 3 months prior to the opportunity close date or create date or something?  If it's the former then it may be that something like Cronkit is your only option.
programmer4hireprogrammer4hire

Eventually I came up with the following, based on one of the comments from this idea:

 

1. Created a second field on the Opportunity Product, Total Price 2
2. Created a Workflow Rule, Update Total Price 2, with a rule criteria that Opportunity Product has a Created Date that equals the last 90 days.  If this is true, it copies the Total Price to Total Price 2.
3. Created a Roll-Up Summary field, Three Month Total Sales Price, that sums on Total Price 2.

 

So far, testing is showing that it is working.

This was selected as the best answer