• greystoke
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi,
 
I have tried various forms of this code ( shown below), but with no sucess,  sometimes it is not complaining but also not retrieving any records.  note: dest is a mobile number
 
Many Thanks
 
Anita
 
// not working but not complaining!!! First attempt
 
sforceClient.Query("Select Id, FirstName, LastName From Contact Where Mobile = ' " + dest + " ' ", bindToForm);
 
// Or second go not working but not complaining!!!
 
sforceClient.Query("Select Id, FirstName, LastName From Contact Where Mobile = '{!Contact_MobilePhone}' ", bindToForm);
 
function bindToForm(queryResult)
{
var obj;
alert("im here in the bindToForm method!!");
if (queryResult.size == 1)
{
var firstName = "";
var lastName = "";
obj = queryResult.records[0];
firstName = queryResult.records[0].get("FirstName");
lastName = queryResult.records[0].get("LastName");
alert(firstName);
alert(lastName);
}
 
// code complaining object doesn't support this query
 
var contact = new sforceClient.Query("FirstName_c, LastName_c From Contact_c Where Mobile = '{!Contact_MobilePhone}' ");
if (queryResult.size == 1)
{
var firstName = "";
var lastName = "";
obj = queryResult.records[0];
if (contact.className == "QueryResult")
{
 firstName = contact.records[0].get("username__c");
 password = qr.records[0].get("password__c");
}
alert(firstname);
alert(lastName);