function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
joblack44joblack44 

Custom search tab

Hi all,

 We want to create a custom search tab based on the standard salesforce search engine.

 The search have to be performed only on specific objects.

 We create a new VF page and a custom tab that display the search criteria and the search button.

 We don't know how to reuse SFDC search engine and renderer !

 

We've made test 

 1 - using SDFC search URL but on clic, the selected tab change we go to the home tab.

"https://cs3.salesforce.com/search/SearchResults?searchType=2&search=Search&sen=001&sen=005&sen=a0K&sen=a06&sen=a0P&str="+ obj.value

  2 - using an iFrame but on clic, the iframe display the entire SFDC portal not only the search result.

 

 

Before doing Apex, i need your help/experiences.

Is it possible to solve our request without apex ?

Have you got any idea ?

 

Regards,

 

Jo

 

bob_buzzardbob_buzzard

The SFDC search URL works fine for me.   Can you post the exact URL that takes you to the home tab?

 

WRT the iframe, you'll probably want to use javascript to set window.top.location to the URL from within your Iframe - that will replace the entire page rather than just the iframe itself.

joblack44joblack44

Here after the code the VF page, we try with and without the tabname

 

<apex:page >
<script language="JavaScript">
    function customsearch(){
        var obj = document.getElementById('searchText');
        window.location= "/search/SearchResults?searchType=2&search=Search&sen=001&sen=005&sen=a0K&sen=a06&sen=a0P&sfdc.tabName=01rQ00000000H8P&str="+ obj.value;
    }

</script>
  <apex:form >
  <input type='Text' id='searchText'/>
  <apex:outputLink value="#" onclick="customsearch();" id="test">Test</apex:outputLink>
   </apex:form>
 </apex:page>

 

 

 

bob_buzzardbob_buzzard

I think I must be misunderstanding something here - I've tried your page and the search works fine for IE, Firefox and Chrome.  It takes me to the standard search results page with the list of matching objects - are you expecting different behaviour to that?

 

joblack44joblack44

Yes indeed, i want to stay on my custom tab.

bob_buzzardbob_buzzard

Ah, I see.  The problem with that is the search results page is just that - a whole page rather than a results frame.

 

I guess this leaves two choices:

 

(1) Use a SOSL search from the controller and write your own results section.

(2) Build the URL in your controller, create a page reference for the URL, get the content and scrape the HTML that you need to render the results (not as hard as it sounds, but it is fragile - if the format changes, your code will need to change as well).

KoteshKotesh

Hi

 

We want to have a custom Search tab or a feature which helps in filtering searching of Case Queues/Users while re-assigning a case.

 

Can anybody give an insight on how we can accomplish this.