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
Anu Raj.ax1269Anu Raj.ax1269 

datetime validation.

Hi

I want to validate a date field. 

The date field in the controller is always updated to system.now();

 in the validatio rule i want to validate the old valu of the datefield with the new value.

 

please help me to solve this problem.

 

Thanks

Anu

Navatar_DbSupNavatar_DbSup

Hi,

You can try this Validation Rule;

PRIORVALUE( ClsodeDate__c )  > NOW()

 

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

Anu Raj.ax1269Anu Raj.ax1269

Hi 

Thanks for your help

but i am gettig error - Error: Function PRIORVALUE may not be used in this type of formula

 

I am trying (PRIORVALUE( Email_Alert__c )  ,  ISCHANGED(Email_Alert__c ) )

at that time also i am getting Error: Function PRIORVALUE may not be used in this type of formula

 

 

Pravesh RanaPravesh Rana

Hi, 

 

PRIORVALUE  return the last value that the field have defore modification.

 

So what I think you are doing is using PRIORVALUE  method in a Boolean Type condition. Look into it and if you are still getting an error, please supply the whole code for reference.

 

You can also use some thing  like this..

 

if( AND(PRIORVALUE( Email_Alert__c) > Email_Alert__c,ISCHANGED(Email_Alert__c)),true,false )