How to remove Arrow button of Search Select Advanced field

By | October 6, 2012

Currently in CRM, for Search Select Advanced of any primary entity there is a small arrow on the right hand side of the SSA field with find and clear options. After clicking on find option the system will open find screen. But if we create Search Select Advance of custom entity and clicks on find option on the arrow the system will get crash since there is no find screen/page created for that custom entity. Of course you can create pages and get it working, however if you simply don’t want the functionality you can remove the arrow right away.
Below is the JavaScript function I have designed which does the task
function RemoveButton(sImageName)
{             
            for(i=0;i<document.all.length;i++)
            {
                        if(document.all[i].className==”SmallButtonItem”)
                        {
                                    if((document.all[i].outerHTML.search(sImageName+”.gif”)>-1))
                                    {
                                                document.all[i].style.visibility = hidden;
                                    }
                        }                             
            }
}
After the customization, a Search Select Advanced will look like shown below.

Happy scripting!