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
sbangasbanga 

Populating custom Date field based on a picklist value

Hello,

 

I am using this formula field to return a date value based on the picklist value selected. It works for one picklist value, however I have 3 values (Monthly, Quarterly, Annual) in the picklist that would update the formula field with different date values and I can't get it to work.

 

I tried using the CASE function, adn kept getting error "Field Monthly does not exist". Any help is appreciated....may be somehow combine three IF conditions in one formula...or do I need to use workflows?

 

IF(ISPICKVAL(Contract_Term__c, "Monthly"), Contract_Start_Date__c  + 30, null)

 

Thanks...

MarkSilberMarkSilber

I'm not sure what the resulting # of days to add to each date is, but this should give you a good start. For this example, I'm using 30 days, 90 days and 365 days. I don't have these fields in my org so I couldn't test it, but it should work.

 

 

CASE(Contract_Term__c,

"Monthly", Contract_Start_Date__c + 30,

"Quarterly", Contract_Start_Date__c + 90,

"Annual", Contract_Start_Date__c + 365, null)

 


 

sbangasbanga

Mark,

 

Thank you so much! this works...I am trying to calculate the contract renewal date based on start date, is there also a way to add months (1, 3, 12) instead of days (30, 90, 365) so the renewal date matches the start date?

 

Thanks again for your help!

Sandeep

MarkSilberMarkSilber

That's a bit more complicated. Search for the following in the Online Help inside your Salesforce instance. It should be the first Solution match:

 

How can I determine and display the expiration or end date 

sbangasbanga
Thanks Mark...I think we may can live with the easier option for right now :) thanks again!