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
Sumi14Sumi14 

Error in - Build a Conference Management App : Create a Lightning Component with Server-Side Apex Controller

Getting as error in the challenge section of Build a Conference Management App - Create a Lightning Component with Server-Side Apex Controller . The error says "There was an unexpected error in your org which is preventing this assessment check from completing: System.QueryException: List has no rows for assignment to SObject". 
This is what the server - side controller looks like: 
public class AttachmentController {
    @AuraEnabled
    public static void updatePicturePath(String recId){
        //In Lightning Experience, Attachments are stored in ContentDocuments
        ContentDocumentLink docLink = [ SELECT ContentDocumentId
                               FROM ContentDocumentLink
                               WHERE LinkedEntityId = :recId order by Id desc Limit 1];
        //ContentVersion Id uniquely identifies the attachment
        ContentVersion ver = [SELECT Id FROM ContentVersion Where ContentDocumentId = :docLink.ContentDocumentId];
        //Update the Picture_Path field with the url of the image
        Speaker__c speaker = [SELECT Id FROM Speaker__c WHERE Id = :recId];
        speaker.Picture_Path__c = '/sfc/servlet.shepherd/version/download/'+ ver.Id;
        upsert speaker;
    }
}
SandhyaSandhya (Salesforce Developers) 
Hi,

I would suggest you try in new trailhead playground as the error says that there are some pre existing configuration that is preventing you.

Best Regards,
Sandhya
SandhyaSandhya (Salesforce Developers) 
Hi,

Adding images to ALL speakers worked for me.

Best Regards,
Sandhya
Ayush Garg 27Ayush Garg 27
I am also getting the same error. I tried creating a new Trailhead Playground but still facing the same error.
AK DAK D
As Sandhya said , adding images to all the Speakers solved the issue.