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!
***Updated 4/9/2010 – Glenn provided a nifty way to prevent the search box from stealing cursor focus here. He suggests to show an image of a search box and replacing the image on mouseover with the actual search box. You need to take the image from his link above and use the following code below:

<form
  id="searchForm"
  action="/search/SearchResults?searchType=2&sen=0&setLast=1"
  method="post"
  name="advsrch"
  onmousemove="if(getElementById('textBoxImage')) {document.getElementById('textBoxDiv').innerHTML='<input id=\'searchField\' maxlength=\'80\' name=\'sbstr\' size=\'18\' value=\'\' type=\'text\'><input value=\' Go! \' class=\'btn\' type=\'submit\'>'}">
  <div id="textBoxDiv">
    <img id="textBoxImage" src="/resource/1269872073000/TextBoxImage2">
  </div>
</form>

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 | 42 Comments »

New Salesforce.com Advanced Search Tool

Written by ShamrockCRM on October 16, 2008 – 7:45 pm

I have created a great new tool for Salesforce.com that makes searching a heck of a lot easier for the average User of Salesforce.

Typically, with the normal Salesforce.com search box, it will ONLY search through Standard fields.  It will NOT search through any of the custom fields that you have created in the system.  This is very frustrating for the User.

Let’s say a User wanted to search for records that contain an external ID to another system in a custom field OR for some characteristic of a record.  ex.  Say you sell Pizza.  You have a field on the Contact record called “Favorite Topping”, with the value of “Pepperoni”.  With the normal Salesforce.com search, if you searched for “Pepperoni”, you would find ZERO results.  See the below screenshot.

salesforce.com advanced search

As you can see, no results showed up for the User.

If you use my new Advanced Search box that I used to replace the old Search box, you can see that Pepperoni immediately returned a result for the User.

salesforce.com search customization

This saves many clicks and TONS of confusion for the average Salesforce user.

Simple, but wonderful!

Click HERE for the Free Salesforce.com Code for this Functionality


Tags: , , , , ,
Posted in Programming, S-Controls, Salesforce.com, Web Development | 5 Comments »