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
Teja SattoorTeja Sattoor 

Subscription End Date for Accounts based on Contract term

Hi,

I am trying to see if could use a formula field to get the Subscription End Date based on the Account's Sign Up Date(not the current renewal start date). This is what I came up with

```IF(ISPICKVAL( SaaS_Lifecycle_Stage__c, "SaaS Customer" ),

IF(ISPICKVAL( Annual_Contract__c , "Yes"),
IF(DATE(YEAR(TODAY()),MONTH(Sign_Up_Date__c ),DAY(Sign_Up_Date__c )) <= TODAY(), DATE(YEAR(TODAY())+1,MONTH(Sign_Up_Date__c ),DAY(Sign_Up_Date__c))-1, 
DATE(YEAR(TODAY()),MONTH(Sign_Up_Date__c ),DAY(Sign_Up_Date__c ))-1),

IF(DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(Sign_Up_Date__c )) <= TODAY(), DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(Sign_Up_Date__c))+29, 
DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(Sign_Up_Date__c ))-1)),NULL)```

The problem with the above formula is that the Subscription End Date changes for Monthly subscriptions(lower half od the formula) based on if the day(sign up date) has passed or not in that particular month.

Thanks,
Teja