Created
March 29, 2017 16:45
-
-
Save Walletau/f7aa2ad53a774292fbff671b40d963be to your computer and use it in GitHub Desktop.
MagicParentsSnippet2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Account a = [SELECT Id, Name, | |
ParentID, | |
Parent.ParentId, | |
Parent.Parent.ParentId | |
FROM Account | |
WHERE Id = '0013600000NHSlW' LIMIT 1]; | |
System.debug('1: ' + a.ParentId); | |
System.debug('2: ' + a.Parent.ParentId); | |
System.debug('3: ' + a.Parent.Parent.ParentId); | |
System.debug('4: ' + a.Parent.Parent.Parent.ParentId); | |
System.debug('5: ' + a.Parent.Parent.Parent.Parent.ParentId); | |
System.debug('6: ' + a.Parent.Parent.Parent.Parent.Parent.ParentId); | |
System.debug('7: ' + a.Parent.Parent.Parent.Parent.Parent.Parent.ParentId); | |
System.debug('8: ' + a.Parent.Parent.Parent.Parent.Parent.Parent.Parent.ParentId); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment