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
David Pirrie 5David Pirrie 5 

Advanced Formulas, Using Picklists in Formulas, 4th Module, Challenge not validating correctly?

https://developer.salesforce.com/trailhead/advanced_formulas/picklist_formulas
Has anyone managed to pass the challenge?
Gives error:
Challenge Not yet complete... here's what's wrong: 
The validation rule does not appear to be working correctly. Marking IsEscalated to true and Priority to Medium did not fire the validation rule.

Testing that same case myself (and some permuations) the Validation rule fires correctly I think...
Here is my validation formula
AND(
ISPICKVAL( Status , "Escalated"),
OR(
IsClosed,
IsClosedOnCreate,
NOT(ISPICKVAL( Priority , "High"))
)
)

Best Answer chosen by David Pirrie 5
Abhishek BansalAbhishek Bansal
Hi David,

The challenge here is to set the IsEscalated field to true and not to set the status to Escalated.
So you are just usomg the wrong field in your formula.
I have tried this challenge on my org and was able to complete it and earn 500 points :)
Please use the below formula in your validation rule :
AND(IsEscalated ,OR( 
IsClosed, 
IsClosedOnCreate, 
NOT(ISPICKVAL( Priority , 'High')) 
) )

Please let me know if you still have any issue with this.

Thanks,
Abhishek Bansal.

All Answers

Abhishek BansalAbhishek Bansal
Hi David,

The challenge here is to set the IsEscalated field to true and not to set the status to Escalated.
So you are just usomg the wrong field in your formula.
I have tried this challenge on my org and was able to complete it and earn 500 points :)
Please use the below formula in your validation rule :
AND(IsEscalated ,OR( 
IsClosed, 
IsClosedOnCreate, 
NOT(ISPICKVAL( Priority , 'High')) 
) )

Please let me know if you still have any issue with this.

Thanks,
Abhishek Bansal.
This was selected as the best answer
David Pirrie 5David Pirrie 5
Abhishek hi,
You are of course correct.
Many thanks for your assistance
David 
Josué PeixotoJosué Peixoto
IF(IsEscalated, OR(IsClosedOnCreate, 
ISPICKVAL(Status, 'Closed'), 
ISPICKVAL(Priority, 'Low'), 
ISPICKVAL(Priority, 'Medium')), 
NULL)
Ankit Khiwansara 10Ankit Khiwansara 10
This formula also worked for me.

IsEscalated  && 
(IsClosed || IsClosedOnCreate ||
Not(ISPICKVAL(Priority, "High")))
Hui  SHui S
I am working on this module and  failed.
Here is my formula
And(IsEscalated,OR( 
IsClosedOnCreate, 
NOT(ISPICKVAL(Status , "Closed")), 
NOT(ISPICKVAL(Priority , "High")) 
))

 
This is the error message I received
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You can only set a case as escalated if it is high priority and not closed: [IsEscalated]
Anyone can point out what I am missing with my formula?  and
I cannot find a checkbox field [Closed] that the other two working formulas were referring to, is this a standard field?

Many thanks!
Harshaprasad SrustuHarshaprasad Srustu
Hello all  and @Hui S,

I understood your question. Since i dont have isClosed field in Case Object please use below formula that worked for me , you can go with below formula. I have achived 500 points

Formula: 

AND(
IsEscalated, OR(ISPICKVAL(Status, "Closed"),
IsClosedOnCreate, NOT(ISPICKVAL(Priority,"High"))))

Please mark this answer as best if I have resolved your answer.

Challenge Successful