You need to sign in to do that
Don't have an account?

lightning global search url
Hi guys, is there a global search in Lightning similar to Classic that use &startURL=/_ui/search/ui/UnifiedSearchResults?str=valueToSearch ?.
If you know something please let me know. Thank you.
-Austin
If you know something please let me know. Thank you.
-Austin
Lightning Application (I named it SearchApp)
Lightning Controller:
Then, you can use https://yourcustomdomain.lightning.force.com/c/SearchApp.app?search=SEARCHQUERY and get redirected to the global search results in Lightning experience
All Answers
Hey Austin,
To search Knowledge and Cases using the case subject. The URL behind the link looks like this:
/_ui/search/ui/UnifiedSearchResults?sen=ka&sen=500&str={!Case.Subject}&initialViewMode=summary&searchAll=false
sen = the objects to search (by object prefix ID) ka is Knowledge and 500 is Cases. 001 is Accounts, 003 is Contacts, etc. See a list here (http://www.fishofprey.com/2011/09/obscure-salesforce-object-key-prefixes.html).
str = the search string
initialViewMode = Initial View Mode (Summary or Detail)
searchAll = should the search run against all objects or not
Seperate each variable with a "&"
Refer this link to know more about What's not available in Lightning experience:
https://help.salesforce.com/articleView?id=lex_gaps_limitations_search.htm&type=0
Hope this helps to solve your problem.
Regards
Diksha Goel
Zen4orce Developer.
First of all, thank you for your response. I think this is not what I'm looking for because this one still use the UnifiedSearchResults which redirect me to the classic, what I'm looking for is something that will redirect me to lightning page instead of classic, without any type of object. Just a string to pass to the global search. If you have any info about it, let me know. I appreciate your help.
Thank you,
Sincerely,
Austin
I noticed the string after the "aloha#" in the URL just after you use the "global search" on Salesforce Lightning is just a Base64 encoded string, so i entered on a website (https://www.base64encode.org) and pasted that string (remember, after the aloha#) and decoded it, and founded this:
{"componentDef":"forceSearch:search","attributes":{"term":"SEARCH STRING","scopeMap":{"type":"TOP_RESULTS"},"context":{"disableSpellCorrection":false,"SEARCH_ACTIVITY":{"searchId":"df6707e4-b867-a197-925b-557d75cc18dc","startTime":1503500649656,"term":"SEARCH STRING"}}}}
Inmediatelly i gone into "Encode" section of website, and tryed the following string (notice i removed the searchId and startTime parameters):
{"componentDef":"forceSearch:search","attributes":{"term":"SEARCH STRING 2","scopeMap":{"type":"TOP_RESULTS"},"context":{"disableSpellCorrection":false,"SEARCH_ACTIVITY":{"term":"SEARCH STRING 2"}}}}
Then Base64 encoded it and pasted it after the "aloha#" (resulting url was something like: https://na30.lightning.force.com/one/one.app?source=aloha#THECOMPLETEBASE64ENCODEDSTRING).
And "voila"... Lightning Global Search working as Classic did...
Wow thanks a lot this is really helpful!! It works perfectly I tried changing the url and it works. Thanks again.
Austin
I would like to speark with someone in salesforce team to confirm if this is supported solution
We need exactly this funcitonality to pass parameters to the global search of Salesforce as we cannot have the Salesforce Record ID exposed to the search generating system and use it directly to open the record detail page by Salesforce ID.
For some reason i fail to replicate the same you explained above when i am using the lightning search and trying to decode the URL
Lightning Application (I named it SearchApp)
Lightning Controller:
Then, you can use https://yourcustomdomain.lightning.force.com/c/SearchApp.app?search=SEARCHQUERY and get redirected to the global search results in Lightning experience
did anyone tried using the aloha format using /one/one.app?source=aloha#{base64code}?. If I tried using the pattern in existing and open salesforce account it works perfectly fine but if I used it with javascript to open a window it doesnt work but other paths work like "/lightning/o/Contact/list?filterName=Recent" I tried to use it with startURL="/one/one.app?source=aloha#{base64code}" it doesnt work I also tried "/one/one.app?source=aloha#{base64}" but it doesn't work. it refreshed the page and remove the base64 code in the address bar.
I hope you can help me.
Thanks
Thank you.
@Kyle absolutely great work. I had to search to find out how to add this code in, but once I did everything worked wonderfully.
You will need to find the Developer's Counsel that can be found at this url.
https://YOURORG.my.salesforce.com/_ui/common/apex/debug/ApexCSIPage?action=selectExtent&extent=apexclass