+ Start a Discussion
Vijay ummedaVijay ummeda 

validation rule for multiple picklist values

Hi Team,

I am trying to create a validation Rule i have custom Field called status it has 4 picklist values(NEW,old,current,upgraded) when any one of the value is selected user shou;ld not be able to edit the Fields.


AND(
    ISPICKVAL( status__c,'NEW'),
    OR(
        ISCHANGED( NHPMS__Re_Admit__c ),
        ISCHANGED( NHPMS__Discharge_Date__c ),
        ISCHANGED( Next_Appointment__c )
)
    ISPICKVAL( status__c,'old'),
    OR(
        ISCHANGED( NHPMS__Re_Admit__c ),
        ISCHANGED( NHPMS__Discharge_Date__c ),
        ISCHANGED( Next_Appointment__c ))
    )
    ISPICKVAL( status__c,'current'),
    OR(
        ISCHANGED( NHPMS__Re_Admit__c ),
        ISCHANGED( NHPMS__Discharge_Date__c ),
        ISCHANGED( Next_Appointment__c ))
    
)
    ISPICKVAL( status__c,'upgraded'),
    OR(
        ISCHANGED( NHPMS__Re_Admit__c ),
        ISCHANGED( NHPMS__Discharge_Date__c ),
        ISCHANGED( Next_Appointment__c ))
    
)
)
Best Answer chosen by Vijay ummeda
Surya GSurya G
Hi Vijay,
try this if this works.

AND(
        OR(
             ISCHANGED( NHPMS__Re_Admit__c ),
             ISCHANGED( NHPMS__Discharge_Date__c ),
             ISCHANGED( Next_Appointment__c )
             ),
        OR(
              ISPICKVAL( status__c,'NEW'),
              ISPICKVAL( status__c,'old'),
              ISPICKVAL( status__c,'current'),
              ISPICKVAL( status__c,'upgraded')
           )
        )
Thanks 
Surya G

All Answers

Surya GSurya G
Hi Vijay,
try this if this works.

AND(
        OR(
             ISCHANGED( NHPMS__Re_Admit__c ),
             ISCHANGED( NHPMS__Discharge_Date__c ),
             ISCHANGED( Next_Appointment__c )
             ),
        OR(
              ISPICKVAL( status__c,'NEW'),
              ISPICKVAL( status__c,'old'),
              ISPICKVAL( status__c,'current'),
              ISPICKVAL( status__c,'upgraded')
           )
        )
Thanks 
Surya G
This was selected as the best answer
CharuDuttCharuDutt
Hii Vijay Unmeda
Try Below Validation
AND(
        OR(
              ISPICKVAL( Status__c,'New'),
              ISPICKVAL( Status__c,'Old'),
              ISPICKVAL( Status__c,'Current'),
              ISPICKVAL( Status__c,'Upgraded')
           ),
       OR(
             ISCHANGED( NHPMS__Re_Admit__c ),
             ISCHANGED( NHPMS__Discharge_Date__c ),
             ISCHANGED( Next_Appointment__c )
             )
        )
Please Mark It As Best Answer If It Helps
Thank You!

 
veer soniveer soni
hy Vijay,
Try Below Rule.
OR(
ISPICKVAL( status__c,'NEW'),
ISPICKVAL( status__c,'old'),
ISPICKVAL( status__c,'current'),
ISPICKVAL( status__c,'upgraded')
)

Try above rule and I don't think you need  ISCHANGED because simply if user select Status new or any that has mentioned and try to save then it will work and if status is already selected before creating validation rule even if will work.

apply it and let me know if it helps you and marking it as best answer.
Thank you