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
JaxBeachJaxBeach 

How do I stop a Lead Aging Field?

Hi,

 

We had a formula on the lead page that calculates the aging of the lead

 

IF ( D2subD1__c > 0,
TEXT(FLOOR( D2subD1__c )) & " days ","" )

 

However, it never stops aging even after the lead has been approved.  How can we stop the field from aging when the lead status field is updated to Approved?  Thanks.

goabhigogoabhigo

You just need to add that condition in the formula logic:

 

IF ( D2subD1__c > 0 && NOT( ISPICKVAL(Status, "Approved") ),
TEXT(FLOOR( D2subD1__c )) & " days ","" )

 

Does this help? If not let me know.

JaxBeachJaxBeach

Thanks.  That did stop it but now the number went away.  Is there a way to keep the aging there so we know how many days it was in the lead cycle after it is closed?  Like if it took 30 days and then it was approved, have the field stop at 30 and still show the 30.  Does that make sense?

goabhigogoabhigo

There could be something wrong in the logic which I give, apologies. I am not testing them in my Dev org.

 

Try the following in a WFR:

 

Criteria:

D2subD1__c > 0 && ISCHANGED(Status) && ISPICKVAL(Status, "Approved")

 

Field update:

TEXT(FLOOR( D2subD1__c )) & " days "

 

You can also put some condition check in your D2subD1 formula OR you can think about lead lifetime reports. Perhaps you can also look into Field History report for Leads - check when the Status was changed to Approved, bring in the field value of this field (aging).

JaxBeachJaxBeach

I tried creating the workflow but got an error message stating that ISCHANGED may not be used in this type of formula.  In looking at my records I also forgot that I need the aging to stop when the lead status is unqualified as well as approved.  Both of those close out a lead.  Thanks.

goabhigogoabhigo
Just use everytime created and edited, that should work with ISCHANGED. --- Regards, Abhilash. Sent from Samsung Mobile
JaxBeachJaxBeach

Looks like it won't let me do a field update to a formula field.  The lead aging field is not available in the drop down list for field to update.

goabhigogoabhigo

Hey you have to use another text field not the formula field. Yes you are correct with workflow you cannot update formula field, in fact you cannot edit it all (only way is to 'make' the field update by changing related fields).

 

Does this help?

JaxBeachJaxBeach

I think I'm getting really confused.  I did create the workflow rule.  I created a new text field called Lead Age so I could update that one instead of the formula field.  For field update I did

 

Lead_Age__c & "days"

 

but after I activate it and go into the record and save the field doesn't update and is blank.

Jeff MayJeff May

You might be able to simplify this.

 

1) Create a WF that sets the DateApproved when the Lead gets Approved.

2) In your original formula field, calculate the diffence between Lead.CreatedDate and today() or Lead.DateApproved depending on the Lead Status.

 

IF(ISPICKVAL(LeadStatus,'Approved'), DateApproved__c - CreatedDate, today() - CreatedDate)