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
TigerPowerTigerPower 

IF field ISPICKVAL, another field must be null (NOT PICKVAL)

Hey, how can I do this:

If one picklist field has value (any other than "none"), the other picklist field may not be selected (must be "none")?

Do  anyone have a solution for this? I've tried to reach to solution by using AND and OR statements (with ISPICKVAL), but I have been more or less validating the field to be required if the other field has been selected. So right now I'm doing it in the wrong way.

 

Regards,

TP

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

are you looking for the liter value "None" in your picklists or do you really mean "no values selected"?

 

depending on what you want one of these should work for you:

 

AND(
NOT(ISBLANK(TEXT(PicklistField_1))),
NOT(ISBLANK(TEXT(PicklistField_2))))


AND(
TEXT(PicklistField_1) <> "None",
TEXT(PicklistField_2) <> "None"))

 

All Answers

Steve :-/Steve :-/

are you looking for the liter value "None" in your picklists or do you really mean "no values selected"?

 

depending on what you want one of these should work for you:

 

AND(
NOT(ISBLANK(TEXT(PicklistField_1))),
NOT(ISBLANK(TEXT(PicklistField_2))))


AND(
TEXT(PicklistField_1) <> "None",
TEXT(PicklistField_2) <> "None"))

 

This was selected as the best answer
TigerPowerTigerPower

Great,

thanks a lot Stevemo!! The first one worked fine with my challenge type of thing. Happy!!

Steve :-/Steve :-/

No problem, you owe me a beer (and I like to drink THESE!) -> http://beeradvocate.com/beer/profile/863/7971

Matt ChisamMatt Chisam
@steve this just helped me as well.  Not nearly as much as what Power of One has done for me, but my Inside Sales office is literally a block from Russian River Brewery (the original).  You're welcome to visit any time!