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
Pathma JemmyPathma Jemmy 

Create a validation rule indicating whether an opportunity has a closed date in the past.

Hi,
When I am try solving this challenge for Opportunity Checkbox , I get this error.
The validation rule is right no error. I also followed  the answers provided in the solution. Everything seems to be good.Pls lmk 
what debugging can be done.

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: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, t2: execution of BeforeInsert caused by: System.NullPointerException: Argument cannot be null. Class.trigger_class.check_opp: line 13, column 1 Trigger.t2: line 2, column 1: []
Keyur  ModiKeyur Modi
Hi Pathma, 

based on the error message which you provided there is null pointer exception on line number 13 in your trigger , meand you are refereing some field which doesnt have value. keep not null condition at line number 13 . 

Please check with that , and if you need more guidance then put your bunch of code with line number 13 , so that it will be easyto help you.

Thanks,
Keyur Modi  
Pathma JemmyPathma Jemmy
Thanks for the reply... 

Actually, I am writing a validation rule for a checkbox field. 
So if the closedate field should be >TODAY()  and the IsClosed field as to be true.
for the checkbox to be true.
So should I check for closedate field or the IsClosed field. Is that right?
Keyur  ModiKeyur Modi
Hi Pathma, 

in line number 13 you are using closeddate field then you have to check null for that field.

Thanks ,

Keyur Modi
Pathma JemmyPathma Jemmy
I Just tried with these validation rules.
1.  AND( CloseDate < TODAY() && NOT(  IsClosed__c ))
2.    NOT(ISNULL( CloseDate ))  && 
AND( CloseDate < TODAY() && NOT(  IsClosed__c ))
3.     AND(NOT(IsClosed__c),(NOT(ISNULL(CloseDate))),(CloseDate <  TODAY()))


For both these validation rules, it's the same error before is prompting.

First I tried with the Number 1 code as I got the error message , I sent you.
As you told to check the "CloseDate " is null used the Number 2 code got the same error.
Then also tried the number 3 code.

Its all the same pls lmk what can be done
 
Pathma JemmyPathma Jemmy
While  trying to do the below trailhead also I am receiving the same error msg.

Using Numbers, Currency, and Percentages in Formulas

 
When I checked in particular formula field I getting the right value in the opportunity page. 
For eg: Radius = 10 ; Height = 10 and Pi value = 3.14159 
Getting it exactly as 314 as they expect without decimal points.
But when I check the challenge it gives the same error message.
 
Pavlo ShchurPavlo Shchur
Hi, for what reason have you put IsClosed__c? It's a standard field.
AND( CloseDate < TODAY() && NOT( IsClosed ))

 
min Chen 9min Chen 9
seriously?
AND(A&&B)? is it not AND(A,B)?
Eike Sommer 3Eike Sommer 3
Thanks Pavlo. I was struggling, but the answer is as "simple" as you stated.