lundi 27 janvier 2020

How to stop counting days using a formula, when a pickist is changed

I have a Picklist called 'status' it has values Tier 1, Tier 2, Tier 3. I have created three fields (Days in Tier1, Days in Tier2, Days in Tier3) to count no of days in each Tier. These fields should start counting when the status is placed into the respective value and should stop counting when moved out of that status.

I have created 3 field update workflow Rules to store The Date when Tier1 is selected(Tier1 Start Date) and I used this formula to count no of days.

Field Name: Days in Tier1, Datatype: Formula --> Number, Formula: TODAY() - Tier1_Start_Date__c

Which is counting the days, but to stop count, when it is moved to a different picklist value.

Should I use an IF formula to stop counting or is there any better way.

I am thinking like IF( ISPICKVAL( Status__c , 'Tier 1') , TODAY() - Tier1_Start_Date__c, NULL)

Please guide me with this.

Thanks, Siva

Aucun commentaire:

Enregistrer un commentaire