Skip to content

Instantly share code, notes, and snippets.

@Walletau
Created March 29, 2017 16:50
Show Gist options
  • Save Walletau/3afa1c7bb38a846b41ea7a07d152724a to your computer and use it in GitHub Desktop.
Save Walletau/3afa1c7bb38a846b41ea7a07d152724a to your computer and use it in GitHub Desktop.
MagicParentsSnippet5
Account a = [SELECT Id, Name,
Owner.Manager.Manager.ManagerId
FROM Account
WHERE Id = '001p000000K12dV' LIMIT 1];
System.debug('1: ' + a.OwnerId);
System.debug('2: ' + a.Owner.ManagerId);
System.debug('3: ' + a.Owner.Manager.Manager.Manager.Manager.FirstName);
System.debug('3: ' + a.Owner.Manager.LastName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment