skuid.sfdc.search stopped working in version 11.2.7

  • 1
  • Problem
  • Updated 1 month ago
  • In Progress
  • (Edited)
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: [
{ "objectName": "Account", "fields": ["Name","CreatedDate"] },
{ "objectName": "Contact", "fields": ["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); 
});



Looks like something's changed. Could someone please advise?

Thank you.



Photo of Gyan

Gyan

  • 1,400 Points 1k badge 2x thumb

Posted 3 months ago

  • 1
Photo of Gyan

Gyan

  • 1,400 Points 1k badge 2x thumb
Any update on this please?
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
When I run the snippet from the documentation, I see this:

Is this what you see?

Where specifically do you think this should be different?
Photo of Gyan

Gyan

  • 1,400 Points 1k badge 2x thumb
Hi Stephen, 

Please see the screenshot (from skuid version 11.1.11)



Photo of jili@heidrick.com

jili@heidrick.com

  • 2,032 Points 2k badge 2x thumb
Hi did you find a solution around this? We are facing the same issue with 11.2.9.
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
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 [line: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