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
AbAb 

validation rule for the changes of the Picklist which depends on another picklist

Hello,

I have a objectCustom__c
with a picklist_custom__c with vaues A, B, C
I have another picklist_custom1__c with values X and Y

I want that the user can change the value of picklist_custom1__c to X only when the picklist_custom__c == C

and once the picklist_custom1__c =X, then he should not be able to modify it

How can i implement the validation rule for the same

thank you
Best Answer chosen by Ab
Ravindra Kashyap 7Ravindra Kashyap 7
Hello Sandrine,

I don't think OWD is required here, please correct me if I am wrong. 
I tried with validation rule for this scenario and working fine, please check let me know it is correct for your use case or not.
OR( AND( ISPICKVAL(picklist_custom1__c, "X"),NOT(ISPICKVAL(picklist_custom__c , "C"))) , AND( ISPICKVAL(PRIORVALUE(picklist_custom1__c),"X" ),ISCHANGED(picklist_custom1__c) ,NOT(ISPICKVAL(picklist_custom1__c, "X")) ) )

Thanks :)
Ravindra Nath

All Answers

Nubes Elite Technologies Pvt. LtdNubes Elite Technologies Pvt. Ltd
Hi Sandrine,

Yes you can use validation rule for this requirement and the field which you want to make uneditable make it's access level to "Read Only" using the OWD.

Thank You,
www.nubeselite.com
Development | Training | Consulting

Please mark this as solution if your problem is solved.
Ravindra Kashyap 7Ravindra Kashyap 7
Hello Sandrine,

I don't think OWD is required here, please correct me if I am wrong. 
I tried with validation rule for this scenario and working fine, please check let me know it is correct for your use case or not.
OR( AND( ISPICKVAL(picklist_custom1__c, "X"),NOT(ISPICKVAL(picklist_custom__c , "C"))) , AND( ISPICKVAL(PRIORVALUE(picklist_custom1__c),"X" ),ISCHANGED(picklist_custom1__c) ,NOT(ISPICKVAL(picklist_custom1__c, "X")) ) )

Thanks :)
Ravindra Nath
This was selected as the best answer