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
CTU007CTU007 

validation rule on forecast category cannot work

Hi, I have this validation rule to prevent sales from overriding the forecast category:

 

or(
and(
case( StageName , "Requirements Analysis", 1, "Qualification", 1, "Proposal", 1, 2) < 2,
Not(ispickval( ForecastCategoryName , "Pipeline"))),
and(
text( StageName)="Negotiation",
Not(ispickval( ForecastCategoryName , "Best Case"))),
and(
text(StageName)="Closing",
text(ForecastCategoryName)<>"Forecast",
text(ForecastCategoryName)<>"Commit"))

 

 

The first two work perfect....

 

 

but the 3rd one (closing stage = commit

 

 and(
text(StageName)="Closing",
text(ForecastCategoryName)<>"Forecast",
text(ForecastCategoryName)<>"Commit"))

 

 

cannot work... I tried many ways to rephase the formula, without luck...

 

What is wrong?

 

CTU007CTU007

This is weird, the following works in my sandbox --- sales can only select "Commit" at closing stage:

 

and(
text(StageName)="Closing",
and(
text(ForecastCategoryName)<>"Forecast",
text(ForecastCategoryName)<>"Commit"))

 

However, when I copy it into my production, it does not work --- sales can still select "pipeline" or "Best Case" as forecast category.

 

Is this a bug in production?

 

 

 

 

CTU007CTU007

I further tested in DE, and it works...

 

I cannot figure out why it does not work in my production...

 

Any help is appreciated....

 

NPMNPM

If I am following this right it seems to be written so that the following would need to be true to trigger the validation:

 The first Set is True OR the second Set is True AND the third set is True.

Is that what you intend or do you want the validation to trigger if any of the three sets are True.

The first Set is True OR the second Set is True OR the third set is True

Or am I misinterpreting?

CTU007CTU007

The rule is triggered either the first set OR the second set OR the third set is true...

 

 

My test in sandbox and DE is purely for the 3rd set, ie, for closing stage, the forecast category should be commit:

 

and(
text(StageName)="Closing",
and(
text(ForecastCategoryName)<>"Forecast",
text(ForecastCategoryName)<>"Commit" )

)

 

This works in sandbox & DE, but NOT in production....

 

 

 

 

NPMNPM

The difference between DE and Prod is too wierd.  Do you need the second and - not that it should matter? 

With the three sets I was thinking you might have an extra parentheses after "Best Case" that is making it OR OR AND rather than OR OR OR but without setting it up to try it is just theory.

CTU007CTU007

Thanks, i tried with/without second and ---- same result in DE and sandbox.

 

 

I tested only the 3rd set (by writing a NEW validation rule with itself) in production also, and it does not work...

 

So there must be something wrong with this forecast category--"commit", its value is actually "forecast" if you check it in excel connector....

 

 

CTU007CTU007

NPM, could you do a simple test in your production on set 3? --- i mean if you use forecast category and are using EE.... 

 

 

NPMNPM
We are on EE but not using forecast category.  Someone else out here must be though.