+ Start a Discussion
Andrew Hoban 6Andrew Hoban 6 

Validation rule if vale is x then a text box must contain information

Hi,
I am trying to create a validation rule for if a value is inserted into the picklist, two text boxes must have information in them. The formula i have created so far is:
OR(
ISPICKVAL(Manufacturer_PC__c, “Apple”),
ISPICKVAL(Manufacturer_PC__c, “Blackberry”),
ISPICKVAL(Manufacturer_PC__c, “HTC”),
ISPICKVAL(Manufacturer_PC__c, “Nokia”),
ISPICKVAL(Manufacturer_PC__c, “Samsung”),
ISPICKVAL(Manufacturer_PC__c, “Sony”),
ISBLANK(IMEI__c),
ISBLANK(serial_number__c ))
If any of them values are chosen in the picklist, IMEI and Serial number textboxes should not be null.
Many thanks.

Best Answer chosen by Andrew Hoban 6
Vatsal KothariVatsal Kothari
Hi Andrew,

You can refer below validation rule:

IF(OR(ISPICKVAL(Manufacturer_PC__c, 'Apple”),ISPICKVAL(Manufacturer_PC__c, 'Blackberry'),ISPICKVAL(Manufacturer_PC__c, 'HTC'),ISPICKVAL(Manufacturer_PC__c, 'Nokia'),ISPICKVAL(Manufacturer_PC__c, 'Samsung'),ISPICKVAL(Manufacturer_PC__c, 'Sony')),IF(OR(ISBLANK(IMEI__c),ISBLANK(serial_number__c )),true,false),false)
If this solves your problem, kindly mark it as the best answer.

Thanks,
Vatsal

All Answers

Vatsal KothariVatsal Kothari
Hi Andrew,

You can refer below validation rule:

IF(OR(ISPICKVAL(Manufacturer_PC__c, 'Apple”),ISPICKVAL(Manufacturer_PC__c, 'Blackberry'),ISPICKVAL(Manufacturer_PC__c, 'HTC'),ISPICKVAL(Manufacturer_PC__c, 'Nokia'),ISPICKVAL(Manufacturer_PC__c, 'Samsung'),ISPICKVAL(Manufacturer_PC__c, 'Sony')),IF(OR(ISBLANK(IMEI__c),ISBLANK(serial_number__c )),true,false),false)
If this solves your problem, kindly mark it as the best answer.

Thanks,
Vatsal
This was selected as the best answer
Andrew Hoban 6Andrew Hoban 6
Thankyou for your responce.
The validation rule does not have any syntax errors and allows me to save, however when I insert a value from the picklist and leave the text box blank, it will still save.


Andrew Hoban 6Andrew Hoban 6
I changed everthing to 'true', and the validation rule worked. Many thanks!