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
Daniel WrayDaniel Wray 

SearchResult object is null

Hi,
 
Please can someone see where this query is going wrong.  I can't seem to return anything although the code is not complaining either.
 
var test = sforceClient.search("FIND {447787502823} IN ALL FIELDS RETURNING Contact (FirstName, Id, LastName)")
         FirstName = "";
        //password = "";
        if (test.className == "SearchResult")
        {
                FirstName = test.records[0].get("FirstName__c");
        }
       alert(FirstName);
  
 
Also tried this on IN PHONE FIELDS BUT neither query returned anything or complained about the code????
 
HELP??? thanks
07-12-2006 02:21 AM
PKDevGuyPKDevGuy
Just curious, why are you giving the field name as "FirstName__c" in your get()? That should be a standard field, so the "__c" isn't needed.

  - Mike
DevAngelDevAngel
Try the search using the SOSL testing tab on the sforce Explorer.  That will actually help you build the SOSL statement, although it looks correct to me.

Also, if you are having trouble with the ajax toolkit, you can always just put the results into an alert.  All of the objects have a toString() override that gives a decent idea of what the object is.

alert(test);