SHARE
TWEET

Untitled

a guest Jan 18th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top