How to get all related objects for an object in Salesforce? November 19, 2018September 6, 2022InfallibleTechie Admin Sample Code: for ( ChildRelationship r : Contact.SObjectType.getDescribe().getChildRelationships() ) { System.debug( String.valueOf( r.getChildSObject() ) ); } Output: