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
GMASJGMASJ 

Pick List Validation to be selected based on the specified value in validation

Hi, 

  In pick list Oppty_Reg_Extension_Request__c  there are two values 

  1. 1st 90 Days Extension
  2. 2nd 90 Days Extension

 User should be able to select first 1st 90 Days Extension and save  only after than he should be able to select 2nd 90 Days Extension

Please let me know how to add this condition in formula. 

Thanks
Sudhir
Best Answer chosen by GMASJ
@anilbathula@@anilbathula@
Hi Sudhir,

Try this validation rule:-

OR(AND(ISNEW(),ISPICKVAL(Picklist__c,"2nd 90 Days Extension")), 
AND(ISCHANGED(Picklist__c),ISPICKVAL(PRIORVALUE( Picklist__c),""), ISPICKVAL(Picklist__c,"2nd 90 Days Extension")))

Thanks
Anil.B

All Answers

@anilbathula@@anilbathula@
Hi Sudhir,

Try this validation rule:-

OR(AND(ISNEW(),ISPICKVAL(Picklist__c,"2nd 90 Days Extension")), 
AND(ISCHANGED(Picklist__c),ISPICKVAL(PRIORVALUE( Picklist__c),""), ISPICKVAL(Picklist__c,"2nd 90 Days Extension")))

Thanks
Anil.B
This was selected as the best answer
GMASJGMASJ
Hi, 

 Thanks for you reply I just need to add one more condition to this formula 
 
 This validation should not be fired for Opportunity Owner and profile with Administrator  Please suggest me how to add this condition.

Thanks
Sudhir




 
GMASJGMASJ
Below formula is working 
OR(AND(ISNEW(),ISPICKVAL(Oppty_Reg_Extension_Request__c,"2nd 90 Days Extension")), 
AND(ISCHANGED(Oppty_Reg_Extension_Request__c),ISPICKVAL(PRIORVALUE( Oppty_Reg_Extension_Request__c),""), ISPICKVAL(Oppty_Reg_Extension_Request__c,"2nd 90 Days Extension")))
&& 
NOT($Profile.Name = 'System Administrator')
&&
NOT(OwnerId = $User.Id)

Thanks
Sudhir