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
VRKVRK 

Required help on Validation rules

Hi ..
i am trying to write Validation rules, but its conflits..can you pls help some one on this.
can someone pls check and let me know whats wrong here ...or if you have any better pls update

 AND
        (
        OR((Contract_Year_End_Date__c > Effective_Date__c),First_Year_Indicator__c = FALSE), 
        ISCHANGED(Contract_Year_End_Date__c )
        )              
    Error Message :
Cant update Contract Year End Date when first Year Indicator checkbox is False 
     AND
     Contract year end date should be less than Effective Date     
Note : its working as expected.

2)        
AND(
OR(
ISPICKVAL(Contract_type__c,"test1"),
ISPICKVAL(Contract_type__c,"test2")
),
First_Year_Indicator__c = TRUE),
ISCHANGED(Contract_Year_End_Date__c)
)
Error Message :
Contract Year End Date Cant be Edited , When First Year Contract Year checkbox is Checked And contract type picklist is test1 Or test2        
        
        Note : Here i am getting conflits ....displaying first VR Message not display this VR Message and also its not matching my requirment 
        
Thanks
RK
Maharajan CMaharajan C
Hi,

Try the below updated formula's:

1.)   Error Message : Cant update Contract Year End Date when first Year Indicator checkbox is False 

AND
(
Contract_Year_End_Date__c > Effective_Date__c,
First_Year_Indicator__c = FALSE, 
ISCHANGED(Contract_Year_End_Date__c )
)      


2.) Error Message :Contract Year End Date Cant be Edited , When First Year Contract Year checkbox is Checked And contract type picklist is test1 Or test2        

AND(
OR(
ISPICKVAL(Contract_type__c,"test1"),
ISPICKVAL(Contract_type__c,"test2")
),
First_Year_Indicator__c = TRUE,
ISCHANGED(Contract_Year_End_Date__c)
)


Thanks,
Maharajan.C
VRKVRK
Thanks Maharajan....for your prompt response
in 2nd Validation Rule, its working AND  able to  popup
 Error Message :Contract Year End Date Cant be Edited , When First Year Contract Year checkbox is Checked And contract type picklist is test1 Or test2   
But , its not allow Save the Record.
Detail scenario :
When picklist value ' test1' and checkbox is True , i display First Year Contract End date is 12/30/2020.  ( thsi logic written in aura controller & working as expected)
But when i try to save this Record,  this VR message display and unable to save the record.
Any ideas ..
Thanks
VRK