Free Salesforce.com Advanced Search Code

Written by ShamrockCRM on March 4, 2009 – 9:41 pm -

Ok, I have decided to be kind.  Everyone saw the post about the Advanced Search tool for Salesforce.com already and loved it.  Everyone requested it and I am in a very giving mood.

This is such a great little tool.  You can’t miss out on this little bit of functionality.

This Salesforce.com code is incredibly simple and very easy to install.  This can be used on any edition of Salesforce, including Group, Professional, Enterprise and Unlimited.

1) All you need to do is create a Salesforce Home Page Component.

2) Make this component of type “HTML Area.”

3) Click the checkbox that says “Show HTML.”

4) Add this snippet of HTML into the box:

<script language="JavaScript" type="text/javascript">
    function submitSearchForm(){
        var searchField = document.getElementById('advsearchfield');
        document.advsrch.action = '/search/SearchResults?searchType=2&sen=0&setLast=1&str=' + searchField.value;
        return true;
    }
</script>
<form name="advsrch" method="post" onsubmit="return submitSearchForm();"><input class="searchTextBox" id="advsearchfield" maxlength="80" size="18" name="sbstr"> <input class="btn" value=" Go! " type="submit"></form>

5) Add this Home Page Component to your Home Page Layout.

6) Done

Wasn’t that easy?  This will now allow you to have one simple search box, remove the old complicated one and search through all custom fields.  (external identifiers are excellent!)

Let me know if you need help installing this!

tanner@shamrockcrm.com

***Updated 4/1/2009 – Thanks Mike for the Small Improvement to the Code!

If you are having problems with the Javascript version, use the below plain HTML version

<form action="/search/SearchResults?searchType=2&sen=0&setLast=1" method="post" name="advsrch"><input class="searchTextBox" maxlength="80" name="sbstr" size="18" value="" type="text"> <input value=" Go! " class="btn" type="submit"></form>

Tags: , , , ,
Posted in Business Analysis, S-Controls, Salesforce.com | 24 Comments »