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
SalesforceCrm AccountCRMSalesforceCrm AccountCRM 

System should automatically calculate 100 days before the contract end date

Hello ,
I have a requirement ,where the system should automatically  calculate 100 days before the contract end date and send an alert to the customer.How can we formulate the formulae ,
 
1)Date dt = Today()+100 and then assign it to contract end date =:dt in a query
2) Date ed = Date.today().addDays(100);
3)contract end date >=Today+100days
4)Date=(today+100 - contractend date)
or how can we calculate..Im in dilemma  which one should work to calculate.Any thoughts or ideas or example very much appreciated.
Best Answer chosen by SalesforceCrm AccountCRM
JyothsnaJyothsna (Salesforce Developers) 
Hi,

You can achieve this functionality by using Workflows with Time trigger or Process Builder.
Please check the below screenshots.
Step1: Create a Workflow rule on Contract Object.

Step2:

User-added image

Step3:

User-added image

Step 4:

User-added image



Hope this helps you!
Best Regards,
Jyothsna

All Answers

kiran punurukiran punuru
Hi,

 You can simply create a formula like this :
 DaysDiff = (contractenddate - today())
 This will give the no of days. 
 Based upon the  above  formula field  you can set an alert using workflow  which will have the condition like this: If DaysDiff is eqaul to 100 then  send an alert.

Regards,
Kiran
 
JyothsnaJyothsna (Salesforce Developers) 
Hi,

You can achieve this functionality by using Workflows with Time trigger or Process Builder.
Please check the below screenshots.
Step1: Create a Workflow rule on Contract Object.

Step2:

User-added image

Step3:

User-added image

Step 4:

User-added image



Hope this helps you!
Best Regards,
Jyothsna
This was selected as the best answer
SalesforceCrm AccountCRMSalesforceCrm AccountCRM
@kiran punuru ,@Jyothsna   :Thanks for your response.But the email alert should go for 100 ,90 ,85 ,60 , 30 days their are few condition for this email to get triggered.So i need to create 'n' no of formulas based on the difference of the contract date and the condition.
kiran punurukiran punuru
Hi,
You can set the conditons from the workflow rules like this:
Refer the below screenshot
User-added image
Sagar PareekSagar Pareek
You can define multiple time based workflow alerts based upon number of days. The way defined by @Jyothsna will work
SalesforceCrm AccountCRMSalesforceCrm AccountCRM
@kiran punuru ,@Sagar Pareek :Thanks for your reply.Apart from the days , i have other condition to be given .Say Condition is when the a)"Status Renewal" is equal to pipeline ,next renewal status And b)when the "Status Renewed next year" is not equal to renewed ,renewed lost. Here "Status Renewal" and "Status Renewed next year" are picklist field.So i need to add all the condition in the criteria met.Apart from creating a criteria can i create a formula in the same WFR.Any Suggestion plz.