+ Start a Discussion

validation rule urgent

Hey Developer.
I want to create one validation rule please help me...
i have three object 1.Mobile module type(field type : text and value which i entered is pc789)
2. active start mode which has (picklis-tfield type) value --- disabled,derated,normal operation
3. tamper level which has (picklist -field type) value --- tamperlevel1, tamperlevel2
 so i want to create one validate rule for if mobile module type value is pc789,
                          active start mode value is derated and tamperlevel value is tamperlevel2
it did not allow to add data in system or throw some error 
please help me???
thank you
Ketankumar PatelKetankumar Patel
I can help. tell me how these 3 objects are related to each other?
hey ketan,
i have one object account and this are the field i wana create one rule and the criteria is ::::
:::::::: mobilemodule type (fieldttype::text)=pc789
:::::::: active start mode ((field type :picklist and option are disabled , derated and normal operation) = disabled (selected)
:::::::: active tamper level ((field type:picklist and option are tamperlevel1 ,tamperlevel2,tamperlevel3)= tamperlevel1(selected)

in this case it allows the user to enter the data in salesforce only ....

.if user select active start mode =derated or normal option and tamperlevel=tamperlevel2 or tamperlevel3 salesforce not allow to user to enter the data in salesforce...
Ketankumar PatelKetankumar Patel
Hi Mike try this validation rule, Change field name according your fields API name.
AND(mobilemodule__c <> "pc789", TEXT(active_start_mode__c) <> "disabled" , TEXT(active_tamper_level__c) <> "tamperlevel1")

Hey Ketan 
Its not working this are picklist field active start mode and tamperlevel
Ketankumar PatelKetankumar Patel
Sorry mike my fault, I used AND Condition. I should have used OR 
OR(mobilemodule__c <> "pc789", TEXT(active_start_mode__c) <> "disabled" , TEXT(active_tamper_level__c) <> "tamperlevel1")

Ketankumar PatelKetankumar Patel
If you want to execute this validation only for new records and not for existing records then you should use this.
AND(OR(mobilemodule__c <> "pc789", TEXT(active_start_mode__c) <> "disabled" , TEXT(active_tamper_level__c) <> "tamperlevel1"),  ISNEW() )

Hey Ketan
If i want to select active tamper level= disabled or normaloperation and rest of the things same what should be new validate rule???
Ketankumar PatelKetankumar Patel
You should use AND Condition for active_start_mode__c and use one of each value of both comparison.
OR(mobilemodule__c <> "pc789", AND(TEXT(active_start_mode__c) <> "disabled",TEXT(active_start_mode__c) <> "normal operation")  , TEXT(active_tamper_level__c) <> "tamperlevel1")

all set bro ...
thank you so much...for ur help
Hey Ketan,
its working only for existing record when i m trying to update or insert new record its not working what should i do//??
thnak you