skuid.sfdc.search stopped working in version 11.2.7

edited October 17, 2018 in Questions
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.



Comments

  • edited August 14, 2018
    Any update on this please?
  • edited August 14, 2018
    When I run the snippet from the documentation, I see this:
    image
    Is this what you see?

    Where specifically do you think this should be different?
  • edited October 23, 2018
    Hi Stephen, 

    Please see the screenshot (from skuid version 11.1.11)



  • edited October 23, 2018
    Hi did you find a solution around this? We are facing the same issue with 11.2.9.
  • Bill McCulloughBill McCullough 💎💎
    edited October 15, 2018
    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
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!