Archive
Disabling Activities rollup view option using Jscript
In CRM, when you choose ‘Related “Regarding” Records’ option from ‘Activities’ left navigation of Account form, It loads Activities rollup view.
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”;
filterOn.options.remove(1);
// Refresh the grid
var evt = document.createEvent(“HTMLEvents”);
evt.initEvent(“change”, false, true);
filterOn.dispatchEvent(evt);
}
};
};
How do I use the script
- Put the above script on form’s onload event
- After the execution of script form looks as below
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
Stats
- 1,484,145 hits
Translate
Categories
Top Posts
- Power Apps component framework (PCF) - Beginner guide
- [Code Snippet] Custom Workflow Activity with Input and Output Params
- Azure DevOps (ADO) | Pipeline failure | You need the Git 'GenericContribute' permission
- [Step by Step] Power Apps Portal - Configure Global Search
- Canvas App -Working with Bing Maps connector
- Associate/Disassociate plugin messages in CRM
- Azure DevOps (ADO) | Pipeline failure | Failed to connect to Dataverse
- Set “Created On”,” Created By”, “Modified On”, “Modified By” fields using SDK/Data Import/Plug-in – Dynamics 365
- [Step by Step] Dataverse | Connect Cloud flow with Service Principal (Application User)
- [Step by Step] Connecting to Azure SQL Server using OLEDB Connection from SSIS
Recent Posts
- General availability of Power Apps for Windows
- PCF | Using Fluent UI and React | Error during react installation
- Power Platform CLI | Pack and Unpack solution using map xml
- Power Platform CLI | Authenticate environment using device code
- Power Apps Maker Portal | Create tables with Table hub and new designer
Calendar
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |