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
Jan Kopejtko 2Jan Kopejtko 2 

Validation rule not firing on ISPICKVAL

This validation rule is supposed to prevent users from adding Quote Line Items if parent Quote has Status of API name 1. Waiting for validation.

It looks like this:

ISPICKVAL(Quote.Status, "1. Waiting for validation")

It does not fire. API name is alright. It works on other Statuses (0, 2 ,3 ,4 , 5), but with this Status number 1 it does not work.
 

What's the problem?

Jan Kopejtko 2Jan Kopejtko 2
This is what my debug log says:

Quote.Status=0. Draft 16:45:19.8 (99493204)|VALIDATION_PASS

The status was 1. Waiting for validation but validation rule says that before evaluating the alidation rule the status is 0?
Andrew GAndrew G
Hi
Given that you say the format works with the other statuses, I would check that the Picklist value is exactly represented in the formula, so check spelling, capitalisation and spacing.  e.g "1. Waiting for validation" is not the same as "1. Waiting for Validation" or "1.Waiting for validation"

Or try

ISPICKVAL(LOWER(Quote.Status), "1. waiting for validation")

If that is not the issue, try playing with BEGINS
BEGINS(TEXT(Quote.Status) , "1.")

Regards
Andrew