Hiding a button on a Dedupe Screen in Sage CRM 2017 R2

Hints, Tips and Tricks

Technical Hints Tips and Tricks that cover customization and development using Sage CRM. API usage and coding are covered.

Hiding a button on a Dedupe Screen in Sage CRM 2017 R2

  • Comments 1
  • Likes

A customer had the following requirement.  They wanted to be able to hide the ‘Ignore Warning and Enter Company’ button for all non-administration users when dedupe was turned on and when Sage CRM flags that the user is entering a duplicate company. The customer wants all users without system administration right to be obliged to return to the first entry screen and in order to double check the data they are entering.

The customer does not want a dedupe list screen to look like this:

They want it to look like this:

This can be achieved using the Client Side API very easily.

The script below can be added into the contents box of the CompanyDedupeList list block.

<script>
crm.ready(function(){
if (CurrentUser.user_per_admin != 3)
{crm.hideButton("NewCompany.gif")}
})
</script>

The script checks the CurrentUser's admin rights. If these are not those of a System Administrator then the button is hidden.
I have made the assumption that the Company Dedupe List will appear only when a possible duplicate has been detected.

Comments
  • Hi Jeff,

    I also use - $("#RightButtonPanel > table > tbody > tr:nth-child(1)").hide(); in place of crm.hideButton.

    I find both your method and this one show the button for a split second when the screen is loading.

    I guess this is normal and can't be hidden before the screen has finished loading?

    Penny