getSobject of CreatedBy field Salesforce Apex February 9, 2021June 9, 2022InfallibleTechie Admin Sample code: sObject obj = [ SELECT Id, CreatedBy.Alias, Name FROM Account LIMIT 1 ];system.debug( obj.getSobject( ‘CreatedBy’ ).get( ‘Alias’ ) );