Hiding the secured key symbol for a secured field.

CRM 2011 has introduced a new concept called field level security. Whenever you create a secured field you will automatically get the secured key being shown just next to it. Can this be avoided?? Imagine a case where you do not want to show your employees that the field is a secured field. In that case this post will help to meet the requirement...

Requirement:

This post will help you to hide the secured key symbol for a secured field in the contact entity.

 

Following are the steps to be followed

1) Navigate to Settings - Customization - Customize the system. It will open a form as shown in the below figure.

 

2) Now expand the entities and click on the forms section as shown in the below figure.

 

3) Open the main form which will open the main form of the contact entity as shown in the below figure.

4) Now create a new field by clicking the on the New Field button at the bottom right as shown in the below figure.While creating the new field Enable the Field Security as shown in the below figure.

 

5) After creating the field place the field in the form as shown in the below figure.

 

 

 

6) Now our target is to hide the key symbol next to the Secured Field. This can be achieved by writing a code snippet in the form load. To achieve the same open the form and click on the form properties as shown in the below figure.

 

 

7) Now edit the library and place the following script in the form load function.

crmForm.all.sample_securedfield_c.innerText=”Custom Field”;

8) This will remove the key symbol and show the "Custom Field" label when the contact form loads.

Comments

  • Anonymous
    April 09, 2012
    For CRM 2011: function HideKeysSecuredFields() {    Xrm.Page.ui.controls.forEach(function (control, index)    {        if (doesControlHaveAttribute(control))        {           HideKey(control);        }    }); } //Aux. functions function doesControlHaveAttribute(control) {    var controlType = control.getControlType();    return controlType != "iframe" && controlType != "webresource" && controlType != "subgrid"; } function HideKey(control) {    control.setLabel(control.getLabel()); }