Polymorphic dynamic search with Skuid?

Not sure if this is a job for Skuid, or something to be coded up with Javascript & Apex, but here goes. I have a Skuid page called Client View that acts as the Account detail page. It’s housed in a Visualforce page that overrides the standard Salesforce Account view page. I also have pages that override Contact and User. All my Skuid pages hide Salesforce’s header and sidebar (we’re effectively “reskinning” Salesforce) and have a common nav bar that I’ve created. The user will often be on the Client View, Contact View or User View page want to easily find and navigate to another account, contact or user. My plan is to have a search box in my nav bar where the user can start typing a string and it returns matching accounts, contacts and users as they type. It’s polymorphic like Salesforce’s global search, but returns records as you type like a Skuid lookup field. The user selects the name of one of the returned records and clicks to navigate to its detail page. Wondered if you could point me to the best approach to take. Thanks as always.

Hi Glenn, Searching across multiple objects all at once is the ideal use case for search with SOSL, which Skuid currently doesn’t use or support at all via any Skuid API methods. So I’d recommend coding this up yourself right now, using JavaScript Remoting to perform the SOSL search on the Apex side, and jQuery UI Autocomplete or something like that for the front-end UI. Zach

OK, that makes sense. Good to know. Thanks.

Glenn, we are doing the same overrides to the SF native header and have the same use case.  Did you ever figure this out?  I actually was able to pull in the SF CSS and was successful at showing the native search Div/ CSS and button on our pages, but the trick now is the Skuid pages can’t access the native sf js.  I used the console to try to identify the native js, but could not pinpoint it. Is there a easier way? 

Hey David … we built this out exactly as Zach described: JQueryUI autocomplete, Javascript remoting and an Apex class that runs the queries. We use it for recent items and search. Works really well.

Ok, awesome…my thinking with that setup is you will have a search field that will autocomplete as you type and bring up a list per the SOSL, i.e…“John Doe” will pass any object related that you define in the query?  

 This could be setup in two ways.

1. The field autocompletes and you click on the result you want, which takes you direct to that record. (Easiest)

2. When you click on the result it redirects to a list view page with multiple model defined tables and then you can choose the record you want. (More involved)

Thanks for the feedback! 

Ours is like scenario 1. User clicks into our search box and recent items instantly appear. Then once they type two characters, the autocomplete returns records from the Apex class. Each record is a link to the relevant detail page. Like this:

Your app is beautiful, Glenn! I love to see what you’ve done with Skuid.

Thanks Emily! When we decided that it had to be beautiful we were wondering just how hard that might be to do, but then along came Skuid to make it a whole lot easier. It’s really been great.

Glenn, are you available to hire to implement this polymorphic search feature for our SF implementation? Thanks, Gary

He’s posted in the marketplace section…
https://community.skuid.com/t/skuid-consulting-services-turn-your-pages-into-killer-pa…

Hey Gary … sorry for the slow reply, I didn’t see this earlier. I’ve just dropped you a note on LinkedIn.

FYI for those interested in using SOSL with Skuid — as of Skuid 6.8.8, Skuid now provides a native JavaScript API that you can use for performing multi-object searches on Salesforce objects using SOSL, and then displaying them in custom UI elements. The method to call is skuid.sfdc.search()— which is documented here

I am not seeing this method. Is there something I need to enable. I double checked my version (see screenshot).

Oops, there was a misprint in my original post about the version number — you need to have 6.8.8+, this method is not available in 6.8.7

Thanks. I will update our version and go from there.