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,555,882 hits
Tweets
- RT @TaikiYoshidaEN: Awesome to see we have a shiny new public facing website for Power CAT! 😻😻😻 microsoft.github.io/powercat/ #PowerApps #PowerA… 16 hours ago
- RT @ravichada: 🎥 The demo video is ready now. Do check out the Dataverse Security Roles risk assessment tool in action. Leave a comment or… 16 hours ago
- RT @ManuelaPichler_: CoE kit but make it more fluent-y #comingsoon https://t.co/kcSzPqwZhM 16 hours ago
- New Blog Post: C# Basics | Why Interfaces rajeevpentyala.com/2023/01/07/c-b… 2 weeks ago
- New blog post : Dataverse solution import error | Environment variable value cannot be an empty string rajeevpentyala.com/2023/01/05/dat… 3 weeks ago
Top Posts
- Power Apps component framework (PCF) - Beginner guide
- [Code Snippet] Custom Workflow Activity with Input and Output Params
- [Step by Step] Connecting to Azure SQL Server using OLEDB Connection from SSIS
- Power Automate Flows | 'Callback Registration Expander' System Jobs stuck at 'Waiting For Resources'
- [Step by Step] Postman tool with Microsoft Dataverse Web API
- God Mode - Level Up - Dynamics 365 Chrome Extension
- [Step by Step] Dataverse | Plugins | Using Dependent Assemblies
- Auto generate new GUID for ‘uniqueidentifier’ column in SQL Table
- Associate/Disassociate plugin messages in CRM
- Power Apps - 'Environment Variables' and their usage in Canvas Apps