You need to sign in to do that
Don't have an account?
AnonTestQuest
Need help with an advanced formula.
I am trying to come up with an expiration date for a custom object's records. The only current fields I can use are the 'created date' of the record and there is a picklist with string values of: 'One Week', 'One Month', 'Three Months', .....
I was doing a new custom field on the object called 'Expiration Date' and using the type as date/time formula. Under advanced tab here, I was attempting 'if' statements to assign numbers to each picklist value but got stumped as to the logic and formatting of how this would look.
Can anyone guide me in the correct direction to work on this?
Thank you in advance!
I was doing a new custom field on the object called 'Expiration Date' and using the type as date/time formula. Under advanced tab here, I was attempting 'if' statements to assign numbers to each picklist value but got stumped as to the logic and formatting of how this would look.
Can anyone guide me in the correct direction to work on this?
Thank you in advance!
All Answers
Please try with below format.
And you need to create Date type of formula field instead of DateTime.
Thanks & Cheers,
Jigar (pateljb90@gmail.com)
CASE(TEXT(Expiration_Period__c),
'One Week', CreatedDate + 7,
'One Month, CreatedDate + ((365.25/12)*1),
'Three Months', CreatedDate + ((365/12)*3),
'')
Just changing the compiled size. CASE Statement would be smaller.
When I created this formula custom field, I chose Date because I need the output to be a date. Should I have chosen Text?
CASE(Duration__c,
'One Week', CreatedDate + 7,
'One Month', CreatedDate + ((365/12)*1),
'Three Months', CreatedDate + ((365/12)*3),
'Six Months', CreatedDate + ((365/12)*6),
'One Year', CreatedDate + ((365/12)*12),
NULL)
https://developer.salesforce.com/gettingstarted?state=id
Attempting to filter out all records except ones that are 2 or less days away from expiring.