ShowAll Questionssorted byDate Posted
SalesforceCrm 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
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
Jyothsna (Salesforce Developers)
Hi,

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

Step2:

Step3:

Step 4:

Hope this helps you!
Best Regards,
Jyothsna

kiran 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

Jyothsna (Salesforce Developers)
Hi,

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

Step2:

Step3:

Step 4:

Hope this helps you!
Best Regards,
Jyothsna
This was selected as the best answer
SalesforceCrm 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 punuru
Hi,
You can set the conditons from the workflow rules like this:
Refer the below screenshot
Sagar Pareek
You can define multiple time based workflow alerts based upon number of days. The way defined by @Jyothsna will work
SalesforceCrm 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.