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
Shruti NigamShruti Nigam 

Need help in validation rule for this

Hi all,

I have a one date field named "Date__c" if user try to edit record after 7 days from the date which i am havng in field "Date__c"  he/she should not able to edit record.

i am not sure this will work with trigger or validation rule.

If any know help me
NehaDabas16NehaDabas16
Hi Shruti,

You can achieve this using validation rule.

If your field is of type date, then use (Date__c+ 7) < TODAY() in formula editor while creating validation rule. And if your field is DateTime, then use (DATEVALUE(Date__c) + 7) < TODAY()

If this helps, please like and mark as resolved.
Ajay K DubediAjay K Dubedi
Hi Shruti,
You can use this one for validation rule, I hope this will work in your scenario
DATEVALUE(Scheduled_Date_Time__c) - TODAY() > 7
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi