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

Look for Contact on ContactId.
Hi,
Here is my code. I have Custom__c object which has Admin person lookup to contacts. I need to find out the details of that contact. So I tried to use this query.
var c = sforce.connection.query("SELECT ID, Name from Contact WHERE Contact.Id = '{!Custom__c.Primary_ContactId__c}'");
didn't return any records.
So I tried this to check if Id's are same -
var c = sforce.connection.query("SELECT ID, Name from Contact WHERE Contact.Name = '{!Custom__c.Primary_Contact__c}'");
var records = c.getArray("records");
alert(records[0].Id);
alert('{!Custom__c.Primary_ContactId__c}');
var records = c.getArray("records");
alert(records[0].Id);
alert('{!Custom__c.Primary_ContactId__c}');
first alert i m getting is - 0033000000ob70wAAB
and second - 0033000000ob75A
Why am I getting different ID's for same contact?
So what should I do to get the detail about Contacts from my custom object?
Thanks
What happens if you try to display the user directly?