• Jon Badiola
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi All,
    Please guide me where I am going wrong. I have created Apex Class as mentioned in the Trailhead module and created Process builder as mentioned. But when I change the Campaign record status to complete, it is throwing an error message below:

here was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Update failed. First exception on row 0 with id 7017F0000013KBxQAM; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “Completed Class Sessions” process failed. Give your Salesforce admin these details. <b>An unhandled fault has occurred in this flow</b><br>An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Error ID: 886669657-104344 (154217274): []

I have debugged some logs and came to know that I am getting query Exception as "System.QueryException: List has no rows for assignment to SObject".
This is the query in the Apex class, which is throwing that exception:
 
WorkBadgeDefinition workBadgeDef = new WorkBadgeDefinition();
    workBadgeDef = [SELECT Id,Name FROM WorkBadgeDefinition WHERE Name = :request.badgeName Limit 1];

This is link to the project:
https://trailhead.salesforce.com/content/learn/projects/workshop_mgmt/workshop_mgmt_apex

Please let me know what step I am missing in the above project to complete this project.

Thanks in advance
Sreenivas