Remove hyperlink from summary caption tags

By | February 13, 2012

In standard CRM you can see summary screen for all entities like Company, Person, Cases, and Communication. To change basic details for the company or Person entity you can choose two ways
1. Click on the Change button from Summary screen (Refer screenshot below.)

2. Click on the Summary Block hyperlink of Summary screen. (Refer screenshot below.)

Through any of the options above person screen will go to editable mode and you can modify the details accordingly.
In most of the cases changing customer details is not allowed to all the operators. Yes, you can change the security settings in CRM not to allow the user to change the person details; however when you have some related entities features enabled with implementation limitations due to securities applied for the same you will have to disable the Change buttons through client side scripting rather than doing it from standard security settings. I have already given the script on this blog to hide buttons, however as explained above the link on summary must also be removed. Below is the script you can write on Custom content box of person summary screen to achieve the same.
//’ Call This Method to Remove Person block hyperlink
RemoveHyperlink(‘Person’);
//’ Remove Person hyperlink
function RemoveHyperlink(pstrLinkCaption)
{
var navlinks = document.getElementsByTagName(‘A’);
for (var i = 0; i < navlinks.length; i++)
{
if (navlinks[i].className==”PANEREPEAT”)
{
LinkTo = new String(navlinks[i].innerText);
LinkToImg = new String(navlinks[i].innerHTML);
if (LinkTo.indexOf(pstrLinkCaption)==0)
{
navlinks[i].removeAttribute(‘href’);
}
}
}
}