EDIT:
CASE( cycle__c,
'Monthly', ADDMONTHS (selected_date__c, 1),
'Yearly',
IF(
AND(
MONTH(selected_date__c) = 2,
DAY(selected_date__c) = 29
),
DATE(YEAR(selected_date__c)+ 1, 3,1),
DATE(YEAR(selected_date__c) + 1, MONTH(selected_date__c), DAY(selected_date__c))
),
DATE(YEAR(selected_date__c)+ 1, 3,3),
DATE(YEAR(selected_date__c) + 1, MONTH(selected_date__c), DAY(selected_date__c)),
Null //Default
)
I have standard Salesforce page and I have two fields which user will choose from
the first field (selected_date__c
) is the date and second field (cycle__c
) is the picklist and based on those two selections, I need to show the calculate_date__c
example:
selected_date__c = 7/17/2022
cycle__c = Monthly
the calculate_date__c
should be 8/17/2022
(because cycle__c selection was monthly so added one month to it)
another example:
selected_date__c = 7/17/2022
cycle__c = Yearly
the calculate_date__c
should be 7/17/2023
I need to show the calculate_date__c
, is that possible using formula field or do I need to think of using Flow?