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
Divya Desai 10Divya Desai 10 

Receiving Apex trigger error suddenly without making any changes to the trigger

I'm receiving the following error for one of our custom objects. I don't understand what the error is and therefore can't implement the necessary fix(es). Can someone explain what this means?

EMAIL ALERT ABOUT TRIGGER
Apex script unhandled trigger exception by user/organization: 00560000006hY5t/00D60000000IoEk
ServiceDetailStageUpdate: execution of BeforeInsert
caused by: System.QueryException: List has no rows for assignment to SObject
Trigger.ServiceDetailStageUpdate: line 2, column 1

ERROR MESSAGE SHOWN IN SALESFORCE WHEN TRYING TO UPDATE RECORD
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger ServiceDetailStageUpdate caused an unexpected exception, contact your administrator: ServiceDetailStageUpdate: execution of BeforeInsert caused by: System.QueryException: List has no rows for assignment to SObject: Trigger.ServiceDetailStageUpdate: line 2, column 1

I can provide more details about the code if necessary.

Thanks in advance!
v varaprasadv varaprasad
Hi Divya,

In the following trigger ServiceDetailStageUpdate you have written some soql query.but it not retrieving any records.
That why it is showing System.QueryException: List has no rows for assignment to SObject:.



Hope this helps you!

Thanks
Varaprasad
@For Support: varaprasad4sfdc@gmail.com
Divya Desai 10Divya Desai 10
Thanks for responding Varaprasad. I figured out that the Apex Trigger code was referencing the incorrect Record Type for one of our custom objects. We're updating the Apex Trigger code which should hopefully fix the error.

Best,
Divya