+ Start a Discussion
Lisa KlenzmanLisa Klenzman 

Trailhead: Apex script unhandled trigger exception by user/organization

I am working in Trailhead on the "Learn CRM Essentials > Leads & Opportunities > Creating a Sales Process and Using Opportunities" module. I try to create the opportunity in the challenge and I get this error:
Apex script unhandled trigger exception by user/organization: 005360000024JQO/00D36000001DoTh
ClosedOpportunityTrigger: execution of AfterInsert
caused by: System.NullPointerException: Attempt to de-reference a null object
Trigger.ClosedOpportunityTrigger: line 9, column 1

What am I doing wrong? How do I fix this? Help.
Best Answer chosen by Lisa Klenzman
Patcs_1Patcs_1
Hi Lisa

But there is a trigger in your org in Opportunity object, you can just go ahead and check, the trigger name is "ClosedOpportunityTrigger"

If that trigger is unneccesary you can deactivate the trigger.

Hope this helps!

Thanks

All Answers

Patcs_1Patcs_1
Hi Lisa

There is an trigger in the Opportuity Object either deactivate the trigger or in that trigger at line no 9 if you are accessing any field or Query it is returning Null. Please make sure that field has value or query is returning some data when you are saving the opportunity.

Hope this helps!

Thanks
Sumeet_ForceSumeet_Force
Pls provide screenshot of code or code snippet....you are possibly referncing something thats null or not initialised..
Lisa KlenzmanLisa Klenzman
I’m not coding. Just trying to complete the challenge. Lisa Klenzman Application Operate & Maintain Land O’Lakes, Inc. 651-375-1523 LMKlenzman@LandOLakes.com
Patcs_1Patcs_1
Hi Lisa

But there is a trigger in your org in Opportunity object, you can just go ahead and check, the trigger name is "ClosedOpportunityTrigger"

If that trigger is unneccesary you can deactivate the trigger.

Hope this helps!

Thanks
This was selected as the best answer
Lisa KlenzmanLisa Klenzman
Thank you. It was the trigger. I found it and deleted it.