function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NewToSFNewToSF 

Trying to find contact info. on contact Id

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}');

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


Message Edited by NewToSF on 04-09-2008 02:05 PM
NewToSFNewToSF
Any help?