Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(object__c conv: database.query(query)){
- List <Attachment> attachmentList = [SELECT Id, Name, ContentType, ParentId FROM Attachment WHERE ParentId = :conv.Id limit 1];
- if (attachmentList.size() > 0){
- Attachment att = attachmentList[0];
- row.AttachmentId = att.Id;
- row.AttachmentName = att.Name;
- row.AttachmentType = att.ContentType;
- }
- list <Attachment> attachmentList = [select Id, Name, ParentId from Attachment];
- for(object__c conv: database.query(query)){
- for (Attachment att : attachmentList){
- if (conv.Id == att.ParentId){
- row.AttachmentId = att.Id;
- row.AttachmentName = att.Name;
- row.AttachmentType = att.ContentType;
- }
- }
Add Comment
Please, Sign In to add comment