Skip to main content

skuid.sfdc.search seems to be broken in skuid version 11.2.7. The following code from skuid documentation (https://docs.skuid.com/latest/en/skuid/api/skuid_sfdc.html#skuid.service.search) does not seem to work anymore.


var $ = skuid.$;
var queryText = ‘skuid’;
// Perform our SOSL Search
$.when(skuid.sfdc.search({
query: queryText,
searching: “ALL FIELDS”,
returning: u
{ “objectName”: “Account”, “fields”: t“Name”,“CreatedDate”] },
{ “objectName”: “Contact”, “fields”: c“FirstName”,“LastName”,“CreatedDate”] }
]
})).done(function(searchResult){
$.each(searchResult.results,function(i,sobjectResult){
var objectName = sobjectResult.objectName;
var records = sobjectResult.records;
console.log(‘* Found ’ + records.length + ’ ’ + objectName + ’ records’);
$.each(records,function(j,record){
if (objectName===‘Contact’) {
console.log('Found Contact: ’ + record.FirstName + ’ ’ + record.LastName);
}
else console.log('Found Account: ’ + record.Name);
});
});
}).fail(function(searchResult){
console.error('Search failed: ’ + searchResult.error);
}).always(function(searchResult){
console.log('Raw SOSL generated: ’ + searchResult.sosl);
console.log(‘Original search request’);
console.log(searchResult.request);
});```


Any update on this please?


When I run the snippet from the documentation, I see this:
73d90888982186348347220555cd7915cd800e1f.jpg
Is this what you see?

Where specifically do you think this should be different?


Hi Stephen, 


Please see the screenshot (from skuid version 11.1.11)



Hi did you find a solution around this? We are facing the same issue with 11.2.9.


Skuid,


I tried reproducing this in my developer org. I think there is a problem.


I used the code that Gyan referenced and added a console log of the searchResult object. I also modified the searchText with a name that is in my developer org. Here is the console.log that I added to the ‘always’ function:


.always(function(searchResult){

console.log('Raw SOSL generated: ’ + searchResult.sosl);

console.log(‘Original search request’);

console.log(searchResult.request);
console.log(searchResult);

});


When I expand the searchResult object, I see this error:


{sosl: null, results: null, error: “Expected Map<String,skuid.SearchRequest.ObjectRequest> but found ;line:1, column:41]”, request: {…}}

error: “Expected Map<String,skuid.SearchRequest.ObjectRequest> but found eline:1, column:41]”

request: {query: “levy”, searching: “ALL FIELDS”, returning: Array(2), dataSource: E}

results: null

sosl: null
proto: Object


I am using Skuid 11.2.10.


Thanks,


Bill


Reply