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

Created a Simplified Search option on left-sidebar to replace new Global Search
Hi everyone,
I actually built a "simplified search" option for our sidebar, and our teams love it! It is a combination of a visualforce page and javascript. Follow the 4 steps below to do the same. Hope this helps!
1) Create a Visualforce page called "advancedsearch"
2) Use the following code as your page (Hint: for the "&sen=" portions in bold, these identify the objects you want to search. For example, &sen=001 is an Account (click on the Accounts tab, and you will see those three numbers in the hyperlink). My code below searches: Accounts, Opps, Contacts, Leads, and Campaigns
<apex:page showHeader="false" sidebar="false">
<apex:pageBlock >
<b>Enter search term: </b>
<apex:form >
<script>
function doSearch()
{
var searchStr = document.getElementById('txtSearch').value;
window.open('/_ui/common/search/client/ui/UnifiedSearchResults?sen=001&sen=003&sen=00Q&sen=006&sen=701&str=' + encodeURIComponent(searchStr), "_parent" );
}
</script>
<input type="text" id="txtSearch"/>
<input type="button" value="Go!" id="btnSearch" onclick="doSearch()"/>
</apex:form>
(<strong>NOTE:</strong> Only searches Accounts, Opps, Contacts, Leads, and Campaigns)
</apex:pageBlock>
</apex:page>
3) Finally, go to setup > customize > home > home page components. Create a new HTML area left sidebar component. On the screen where you can enter in the HTML, make sure you select the checkbox "Show HTML" and then paste the following (this references your visualforce page and displays it in the sidebar):
<IFRAME height=150 src="/apex/advancedsearch?core.apexpages.devmode.url=1" frameBorder=0 width="100%"></IFRAME>
4) Add the custom component to your pagelayouts and test it out!
this is cool! you should totally post this on the new Cookbook site.
How do you make it where it will search when you press enter? It only searches if you click it.
Getting it to work when pressing enter means making a submit button within a form, but I had to go further because the behavior is different between IE, Firefox and Chrome. This finally worked for me across all browsers. I still have trouble with Chrome displaying redirect loops, but I can deal with that since I'm the only one using it.
this is a great solution. for my sales guys just doing acct and contacts in that sidebar, and it adds the * so the partial works, is awesome. thanks!
I followed the directions but get this message when I submit the search:
You may have reached this page after clicking on a direct link into the application. This direct link might be:
• A bookmark to a particular page, such as a report or view
• A link to a particular page in the Custom Links section of your Home Tab, or a Custom Link
• A link to a particular page in your email templates
If you reached this page through a bookmark, you are probably trying to access something that has moved. Please update your bookmark.
If you reached this page through any of the other direct links listed above, please notify your administrator to update the link.
If you reached this page through a link on our site, please report the broken link directly to our Support Team and we will fix it promptly. Please indicate the page you were on when you clicked the link as well as any other related information. We apologize for the inconvenience.
Thank you again for your patience and assistance. And thanks for using salesforce.com!
OK the
part of the code is telling it what objects to look in, but how do you know what objects have what numbers?
If you click on a tab in SFDC, you will see the object numbers in the hyperlink.
For example, if you click on the Accounts tab, the hyperlink will read: https://na1.salesforce.com/001/o
Thus, to search in Accounts, use "001".
I have recieved the same URL No Longer Exists when I copied and pasted this in creating the page, can someone let me know why?
I have followed the directions but all I get in the tab on the left is the html code. I am not allowed to click on anything since it did not recognize the Home Page Component script. I have tested in both Chrome and IE 9. Is there also anyway to restrict the search to a custom field within an account?
Thanks,
After many attempts, I came accross this article. I made a very simple modification to the code, replacing the:
window.open('[linktoreport?pv0=' ...
It worked! so thank you.