+ Start a Discussion
pranav shah 40pranav shah 40 

Validation Rules in Salesforce

Hi Guyz,

I just want to create one simple vvalidation rule for a picklist value,

I am inserting a Library Name , once i fill the name, then there is Location with different picklist value.
For Eg: If user enter a name as "Mumbai Library"(Name Would be anything everytime), then location i would be selecting as "Mumbai", records get saved. but while editing the same record,it should not make me change to other location rather than Mumbai...
how it can be done...

I have wriiten below formula, but its not working as per my requirement

AND( ISPICKVAL( Location__c , "Mumbai"), NOT(ISBLANK( Name )) )

please help me to sort out

Pranav Shah

Best Answer chosen by pranav shah 40

You can try the below, If you would like to trigger this only for mumbai locations (So if a user enters any other location other than mumbai then it throws the error).

TEXT(Location__c ) <> "Mumbai"

else if you would like to make it based on location value then 

TEXT(Location__c ) <> PRIORVALUE(Location__c )

Hope this helps ...!!!

Please mark as best answer if the above helps ...!!!