Remove New Company and New Person buttons from the New Case screen

By | April 18, 2012

Usually the client’s requirements are something to do with enhancing the existing screens or functionality. However sometimes we do come across requirements where they need to remove some features from existing standard screens. Its generally not recommended to take drastic steps but it was a business need.
Sage CRM provides us with options to Create New Company and New Person when we are creating New Case. This simplifies the process of creating New Company and then creating cases against it. The New Company and New Person buttons are provided in the For block section in the screen as shown in the below screen shot.

However the requirement was to remove these buttons as the client did not want the user to create new company or person while creating New Case, instead use the existing ones.

To achieve this we need to add the below script in the custom content section of the CommWebPicker screen.
<script for=window event=onload>
//’Remove New Company button
RemoveButton(“New Company”,”NewCompany”);
//’Remove New Person button
RemoveButton(“New Person”,”NewIndividual”);
//’ Remove New Button
function RemoveButton(sCaptionName,sImageName)
{
for(i=0;i<document.all.length;i++)
{
if(document.all[i].className==”SmallButtonItem”)
{
if(document.all[i].outerHTML.search(“For”)>-1)
{                                                                                        if((document.all[i].outerHTML.search(sImageName+”.gif”)>-1) || (document.all[i].outerHTML.search(sCaptionName)>-1))
{
document.all[i].style.visibility = hidden;
}
}
}
}
}
</script>