0

I have the following query:

List<Document> attachments = [Select Id, Name, Type, Folder.Name, FolderId From Document WHERE Folder.Name = 'Team Attachments'];

In Lightning I have the same library Team Attachments. enter image description here How do I change the above query to retrieve all attachments from the Team Attachments library to make it work under Lightning Experience?

1

Query will be same. You need to use @AuraEnabled method to return the records.

@AuraEnabled
public static List<Document> getTeamAttachments(){
    List<Document> attachments = [Select Id, Name, Type, Folder.Name, FolderId 
                                         From Document 
                                         WHERE Folder.Name = 'Team Attachments'];
    return attachments;
}

You can iterate over returned list of attachments in lightning component javascript

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.