How to hide emergency phone in person screen panel

SOLVED

Hello,

We're wanting to remove/hide the emergency contact number from the person summary screen (even if it's not null) and the phone/email tab. See attached screenshots where these appear in our instance of Sage CRM.

Does anyone know if this is possible?

Parents
  • 0

    It is but it's a fiddle. These fields are controlled by translations. The only way you can do it is to write a custom content script on another screen and basically traverse through the DOM and remove them. They don't have element IDs either so you need to search for the string Emergency: and then hop on through the DOM a bit more and find the number if it is there and then hide it using CSS. For the edit screen it would be a bit easier as the fields have IDs but you then don't have a way to put a custom content in unless you use the top content box. It isn't easy.

    Unless anyone has any ideas using the client side API

  • +1 in reply to Vega
    verified answer

    Something like:

    $("td.VIEWBOXCAPTION:contains('Emergency:')").first().parent().hide()

    will get you most of the way there.

  • 0 in reply to Chris Burke

    Thank you both for the quick responses.

    Couldn't seem to get this to work in a Custom Content area in the Person screen, however managed to get it working by adding the following to the bottom of the 'WWWRoot\js\crm\notifications.js' file to completely remove the element from DOM.

    $(document).ready(function() {
        $( "td.VIEWBOXCAPTION:contains('Emergency:')" ).first().parent().remove();
    });

  • 0 in reply to sfranks

    Rather than tag it onto the end of an existing file (because then you're at the mercy of the thing being overwritten when the system is upgraded) it might be a better idea to create your own .js file containing the code above and drop it into the WWRoot\js\custom folder. Once you restart IIS (or just the CRM App Pool) then CRM will pick up the custom file and apply it to each page.

  • 0 in reply to Chris Burke

    This is awesome! I tried adding a new file to WWWRoot\js\custom, but missed the IIS Restart and wondered why it wasn't being picked up.

    Thank you again

Reply Children
No Data