You need to sign in to do that
Don't have an account?

Getting a Relationship Result
How do you get the results for a relationship?
Code:
var sql = "Select Doctor__r.OwnerId,Doctor__r.Name,Name,First_Name__c,Last_Name__c,Id from Patient__c where Id = '" + records[i].get("Patient__c") + "' Limit 1"; var patqr = sforce.connection.query(sql); newCell.innerHTML = patqr.getArray("records")[0].get("Doctor__r.OwnerId");
I get a null. Should it be <Doctor__c> ???
If this doesn't work for you then there's probably some other reason why you can't get at the related data.