+ Start a Discussion
Ian QuahIan Quah 

Getting Owner information within apex (methods found online not working)

Public Clinic_Patient__c patient{get;set;}
Public Clinic_Patient__c  patient_owner{get;set;}
Public String SurgeryID{get;set;}


SurgeryID = System.currentPageReference().GetParameters().get('SurgeryID');
patient = [SELECT Patient_Name__c FROM Clinic_Patient__c where Id = :SurgeryID];
patient_owner = [SELECT Owner.Name, Owner.firstname, Owner.email FROM Clinic_Patient__c where Id = :SurgeryID];
My sample code is as above. When I do
 
System.debug(patient_owner)
all I see is just the OwnerID, and the ID (I do not see Name, firstname or email). Does anyone know what's happening? I have verified that those things exists and that it should not be null or empty.