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
Sreenivas VSreenivas V 

Build an Automated Workshop Management System: Unable to complete last challenge

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
Sreenivas VSreenivas V
Hi All,
   I got an answer in another thread. I need to create Badge called 'Thanks' in Badge object.
Jon BadiolaJon Badiola
Hi Sreenivas, 
I hope you are not still stuck with this one. I was, and I just found out that there is a typo in the GiveWorkThanksAction class: the type of the FeedItem Post was wrongly created as "post.Type = 'RypplePost', instead of "RipplePost".
If you go top the Developer Console,  GiveWorkThanksAction class, search for RypplePost and replace with RipplePost, all works.
Good luck and I hope you get your badge! :-)