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
CRMandresGCRMandresG 

Difference between date fields rule

I have two date fields on my Event.

 

'Start' (which is standard) and  Lead_Date_Assigned__c

 

I need a rule saying the difference between the 'Start" date and the Lead_Date_Assigned__c cannot be greater then 90 days.

 

Can someone point in the right direction?

Daniel HaselhanDaniel Haselhan

You can subtract dates in validation rules.

 

So (StartDate -  Lead_Date_Assigned__c) < 90 would be your validation rule.

 

Check out this page for some examples:

http://na6.salesforce.com/help/doc/en/fields_useful_field_validation_formulas.htm#DateValidation

 

The Date Must Be Within One Year of Today is close to what you are looking for.

CheyneCheyne

Actually, since the formula should return true when an error message is to be displayed, it should check if the difference is greater than 90 days, so it would read as follows:

 

(StartDate - Lead_Date_Assigned__c) > 90

CRMandresGCRMandresG

"Start" is a standard filed, 

 

When I insert that statement into my formula, I get the following Error: Field StartDate does not exist. Check spelling.

 

I have tried inputting "Start"/ "StartDate"/ "StartDateTime with same message.  Does it have to be custom?

 

Any suggestions?

Steve :-/Steve :-/

The standard Event.Start field can't be accessed by Formulas, VR's or WFR, it's a Dead End  (sorry)