Posts Tagged ‘Hide’

Disabling Activities rollup view option using Jscript

January 23, 2014 Leave a comment

In CRM, when you choose ‘Related “Regarding” Records’ option from ‘Activities’ left navigation of Account form, It loads Activities rollup view.

Activities Rollup view option

Activities Rollup view option

Recently we got a requirement to disable rollup option.

So we used below script to remove the ‘Related “Regarding” Records’ option from “Include” dropdown.

document.getElementById(“navActivities”).onclick = function () {

Mscrm.Details.loadArea(this, “areaActivities”);

document.getElementById(“areaActivitiesFrame”).onreadystatechange = function () {

if (this.readyState == “complete”) {

var doc = this.contentWindow.document;

var filterOn = doc.getElementById(“crmGrid_Account_ActivityPointers_ViewControl”);

filterOn.value = “ImmediateRelatedView”;


// Refresh the grid

var evt = document.createEvent(“HTMLEvents”);

evt.initEvent(“change”, false, true);





How do I use the script

  • Put the above script on form’s onload event
  • After the execution of script form looks as below
Hide 'Related Records'

Hide ‘Related Records’

What  are we doing in script

  • Get the Activities IFrame id (i.e., areaActivitiesFrame)
  • When the IFrame load completes (i.e., readyState == “complete”)
    • Get the “Include” dropdown control (i.e., ‘crmGrid_Account_ActivityPointers_ViewControl’)
    • Remove the ‘Related “Regarding” Records’  option

Note – The above script is unsupported which is not recommended and works for pre & post UR 12

“Add Existing” button is missing from associated view ribbon – Reason & Fix

October 27, 2012 2 comments

We get “Add Existing” button when you have relationship between 2 entities and when you select “Associated View” or “Sub grid” of child entity.

Consider this scenario

  • I have 2 custom entities in my system
    • Policy Holder
    • Policy
  • I have 1:N relationship between Policy Holder & Policy (i.e., #1 ‘Policy Holder’ can have #N ‘Policies’)
  • I have added  a sub grid with name “Whole life Policies”  of “Policies” entity, on my “Policy holder” form
  • When I select sub grid “Whole life Policies”  of “Policies” entity, I get both “Add New Policy” & “Add Existing Policy” buttons on my ribbon
Sub Grid with Add existing button

Sub Grid with Add existing button

P.S. The availability of “Add Existing” button depends on “Requirement Level” property of “Relationship”

  • Going back to the scenario, when I open Relationship form of “Policy Holder” & “Policy”, the “Requirement Level” chosen as “No Constraint”
Requirement level - No constraint

Requirement level – No constraint

  • That’s why I had “Add Existing Policy” button when I chose Policy Sub grid on “Policy Holder” form

“Add Existing” button will go off if I set “Requirement Level” property to “Business Required”

  • Now let me change “Requirement Level” to “Business Required” on Relationship form


Requirement Level - Business Required

Requirement Level – Business Required


  • Save & Publish
  • Now I don’t get “Add Existing Policy” button when I chose Policy Sub grid on “Policy Holder” form
No Add existing button

No Add existing button

Take aways :-

  • So this is one way of hiding “Add Existing” button by making  “Requirement Level” to “No Constraint” on Relationship customization.
  • You can also hide the “Add Existing” button by using Ribbon Customizations.


Hide left navigation items pane on form in CRM 2011

December 12, 2011 5 comments


We can Hide the “Navigation items” pane on the CRM form using simple form customization.

    • Open CRM form customization screen
    • Click on “Form Properties” button in  “Form” tab
    • Go to “Display” tab and uncheck “Show navigation items” (Refer screen below)
    • Save & Publish
Hide Nav Items section

Show/Hide Navigation items setting

After this setting “Open” the form and you will get form without “Navigation” section (As below)

CRM form with no Navigation section

CRM form with no Navigation section

Hope this helps 🙂


Hide or Show Tabs & Navigation Items of CRM form in CRM 2011

October 27, 2011 2 comments


Below is the JScript to Show or Hide Tabs and Navigation Items on CRM form

//Set “true” to Hide and “false” to show the Tab/Navigation item



Note :-

  • We can get the ‘Tab’ name, from the Form customization
  • We can get the “Navigation link” name using the IE developer tool (i.e., On the browser Press F12)

Hope it helps 🙂