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

case validation rule


I have a question here that I could not solve with a simple validation rule:

I have a picklist field and a text field. I want to stop users (customer portal users) from creating cases when this condition/formula is not true:

IF picklist value contains text value = true

Is it possible?

No, picklists don't work that way.  You can only match on exact values there -- you can use the ISPICKVAL function to match on them.
Would it be possible to do it with APEX code? some kind of before insert trigger?

Yes, you can do that with an Apex trigger, just throw a ValidationException when your criteria are met.
Thank you! Now I just need some Apex code injection :-)