+ Start a Discussion
Hitesh KhannaHitesh Khanna 

how do i write validation rule for this ?.

"User cannot change status to invoicing if previous status was Pharma Payment, Member Payout, Payment Processing, or Complete".......(these are the picklist values) .


I tried this..but its not working.


IF(ISPICKVAL(Status__c,'Invoicing'), 
    ISPICKVAL(Status__c, 'Pharma Payment') ||
    ISPICKVAL(Status__c, 'Member Payout') ||
    ISPICKVAL(Status__c, 'Payment Processing') ||
    ISPICKVAL(Status__c, 'Complete')
 ,
false )



Response will be appreciated.


 
Best Answer chosen by Hitesh Khanna
CharuDuttCharuDutt
Hii Hitesh
Try Below Validation Rule
AND(ISPICKVAL(Status__c,'Invoicing') ,
OR( 
NOT(ISPICKVAL(PRIORVALUE(Status__c),'Pharma Payment')), 
NOT(ISPICKVAL(PRIORVALUE(Status__c),''Member Payout')),
NOT(ISPICKVAL(PRIORVALUE(Status__c),'Payment Processing')),
NOT(ISPICKVAL(PRIORVALUE(Status__c),'Complete'))))
Please Mark It As Best Answer If It Helps
Thank You! 

All Answers

CharuDuttCharuDutt
Hii Hitesh
Try Below Validation Rule
AND(ISPICKVAL(Status__c,'Invoicing') ,
OR( 
NOT(ISPICKVAL(PRIORVALUE(Status__c),'Pharma Payment')), 
NOT(ISPICKVAL(PRIORVALUE(Status__c),''Member Payout')),
NOT(ISPICKVAL(PRIORVALUE(Status__c),'Payment Processing')),
NOT(ISPICKVAL(PRIORVALUE(Status__c),'Complete'))))
Please Mark It As Best Answer If It Helps
Thank You! 
This was selected as the best answer
Mukesh kumar 472Mukesh kumar 472
Hi
Hitesh Khanna...

Use This Validation Rule
 
AND(ISPICKVAL(Status__c,'Invoicing') ,
OR( 
NOT(ISPICKVAL(PRIORVALUE(Status__c),'Pharma Payment')), 
NOT(ISPICKVAL(PRIORVALUE(Status__c),''Member Payout')),
NOT(ISPICKVAL(PRIORVALUE(Status__c),'Payment Processing')),
NOT(ISPICKVAL(PRIORVALUE(Status__c),'Complete'))))
Hanuman Chalisa Lyrics And Benefits (https://www.sursaritatechknow.com/2021/06/hanuman-chalisa-lyrics.html)