Case, Lead, and Opportunity Age Tracking [Unmanaged Packages]

One of the more popular posts that I’ve had is How to track the Case Age of each Status.  This is one of those posts that is focused on the Case scenario, but the concept applies to many of the Objects in Salesforce.  What I’ve done is create three packages:

  1. Case Status Age
  2. Opportunity Stage Age
  3. Lead Status Age
    • Installation Notes: 
      1. Add the Lead Status Values to the Status Picklist on the Lead Status Age Object
      2. Update the IsClosed__c field to be TRUE for your Closed Lead Status Values
      3. Verify Permissions.End Users don’t need access to Create/Edit/Delete the Lead Status Age Object.
      4. Add the Related List to your Lead Page Layout
      5. Create Reports & Dashboards

These are all set for you to install.  For a better understanding of how this works, please do read up on the post mentioned above.  If you have any suggestions that would improve these packages, please leave a comment or message me on twitter to let me know.

In addition, I’ve decided to launch a new page to house all of my unmanaged packages that I’ll be making available.  You’ll see another tab at the top of my blog called Packages that will be your go-to for this.  I look forward to adding additional packages that hopefully will provide value to you!


11 thoughts on “Case, Lead, and Opportunity Age Tracking [Unmanaged Packages]

  1. Ido Greenbaum January 2, 2017 / 8:01 pm

    Thanks David, for this very useful package.

    Just one quick question – the Case Status Time is added to the ‘all updates’ feed.
    Do you know if this can be somehow removed (to avoid clutter)?
    (see screenshot here –

    I’ve pipped under ‘Feed Tracking’ settings, but it appears no Case Status Time fields are being tracked. I understand it’s a ‘Case Created’ feed item, and wonder if it’s controllable.


    • David Litton January 2, 2017 / 8:19 pm


      This is controlled on the Case’s Feed Tracking (Setup –> Customize –> Chatter –> Feed Tracking).

      It would seem that in the Case Object you have the All Related Objects checked. This is an All or None type thing.

      You could also look at using a Feed Filter as an option to clean this up if you don’t want to uncheck the box mentioned above.



      • Ido Greenbaum January 3, 2017 / 2:48 pm

        Thanks David.
        Un-ticking ‘all related object’ indeed leaves these updates out of the ‘All Updates’ filter.
        We have a customized filter – ‘Interactions’ to list only customer facing Emails and Comments, but we also wanted to leave the Case Status Update out of the ‘All Updates’ filter to avoid clutter.

        Thanks again for publishing this.


  2. Randi Thompson January 10, 2017 / 12:38 am

    Hi David, I thought I would install the Case package into a Sandbox first, but I can’t seem to log into the Sandbox directly (this has happened before, where I need to log into Prod first and THEN use the Sandboxes to log into a Sandbox). Best Practice, especially for unmanaged packages is to install in Sandbox first so you can do tests upon deployment into Prod. Is there a workaround to install in a Sandbox or does it have to go straight into Prod? Thanks!


    • David Litton January 10, 2017 / 5:16 am

      Randi, you can adjust the URL and it will work for a Sandbox. Replace “Login” with “Test” and it will be all set for your Sandbox. OR… you can just be logged into your Org and paste the “/packaging/installPackage.apexp?p0=04ti0000000YEO8” into your URL to have it install without forcing another login (fun fact, but be careful). That’s a good point about needing the Sandbox URL, and I’ll look to update this page this weekend with a link to Prod and Sandbox URLs. Thanks!!


      • Randi Thompson January 10, 2017 / 12:46 pm

        Aha! Thank you!


  3. Carrie Anderson January 23, 2017 / 4:49 pm

    Hi David,

    Installed the Opportunity Stage Age package, added our Stage values to the Stage picklist on the Opportunity Stage object, deactivated the out of the box values, poked around in the components and the Flow OpportunityStageAge_Flow fails and sends me an email telling me

    An error occurred at element Create_Stage_Age_Record (FlowRecordCreate).
    INSERT — INSERT FAILED — ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [Opportunity__c]

    The custom field Opportunity_c is there on the Opportunity Stage Age object, do I need to create a custom field on the Opportunity object?

    Not sure what’s missing……


    • David Litton January 23, 2017 / 4:54 pm

      Did you activate a different Flow or Process Builder version? It seems that you might have deleted the variable that is assigning the Opportunity ID to the Opportunity__c field. This is a Master-Detail relationship and is required. Ensure that the Process Builder is passing in the Opportunity ID and it is being on your Record Create and Lookups.


      • Carrie Anderson January 23, 2017 / 5:06 pm

        Hi David,

        Unfortunately I didn’t touch anything just looked to see what the installed package contained. See attached images.





  4. Alan Kinsley May 18, 2017 / 7:37 pm

    Hey David, We are using this and love it! Especially for Cases.

    We have a use case where we need to track two Status fields of a Quote at the same time, ‘Internal Approval Status’ and ‘Stage’. These are two separate picklists.

    So the question is, how/where in the configuration can I have the ability to track both on one Object?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s