Guest User

Untitled

a guest
Jan 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. List<Contact> con = [SELECT Id, (SELECT Id, Name, CreatedDate, ContentType FROM Attachments WHERE ContentType ='application/pdf' ORDER BY CreatedDate DESC) FROM Contact LIMIT 10];
  2.  
  3. for (Attachment a : con.Attachments) {
  4. if (a.Name.startsWithIgnoreCase('Resume_')) {
  5. [...]
  6. }
  7. }
  8.  
  9. Contact[] people = [SELECT (SELECT Name FROM MothersChildren__r),
  10. (SELECT Name FROM FathersChildren__r)
  11. FROM Contact];
  12.  
  13. for (ChildRelationship relation : SObjectType.Contact.getChildRelationships())
  14. if (relation.getChildSObject() == Attachment.sObjectType)
  15. system.debug(relation.getRelationshipName());
  16.  
  17. SELECT Name, (SELECT Name FROM Job_Applications__r) FROM Position__c
Add Comment
Please, Sign In to add comment