Category Archives: Java Script

Generate the Word Document in JavaScript using Word Templates


Pre-Requisites: Add XRMServiceToolKit Library (Click Here) Add Process Helper Library (Click Here) Follow the Steps below. //Fetch XML for Getting the ID of Document Template var templateName = “Testing Template”; var fetchXml = “<fetch version=’1.0′ output-format=’xml-platform’ mapping=’logical’ distinct=’false’>” + “<entity … Continue reading

Posted in CRM, Dynamics 365, Java Script, JavaScript, Ms Dynamics CRM 2013, MS Dynamics CRM 2015, MS Dynamics CRM 2016 | Tagged , , , , , , , , , , , , , , , , , , , | Leave a comment

Remove or Hide Business Process Buttons


To Hide the Business Process Buttons cannot be done OOB. To achieve this add a HTML Web Resource on Form and paste the following code. See the magic. 🙂 HTML Web Resource: $(document).ready(function () { // Hide Next Stage button … Continue reading

Posted in CRM, HTML, Java Script, JavaScript, MS Dynamics CRM 2015, MS Dynamics CRM 2016 | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Restrict Lookup Types for Regarding Lookup on Activities


With the following couple of lines of code, we can easily restrict the Lookup Types in Lookup Dialog. var regarding = Xrm.Page.getAttribute(“regardingobjectid”); regarding.setLookupTypes([“account”,”contact”]);

Posted in CRM, Java Script, Ms Dynamics CRM 2013, MS Dynamics CRM 2015, MS Dynamics CRM 2016 | Tagged , , , , , , , , , , , , , , , | 2 Comments

Re-Activate Case Plugin


If Case is getting Re-Activated and need to perform some logic. Following is the Code snippet. It should be registered on both messages i.e. SetState and SetStateDynamicEntity. IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); if (context.InputParameters.Contains(“EntityMoniker”) && context.InputParameters[“EntityMoniker”] is EntityReference) { EntityReference entity … Continue reading

Posted in CRM, Java Script, Ms Dynamics CRM 2013, MS Dynamics CRM 2015 | Leave a comment

Resolve Case without Case Resolution Dialog


Resolve Case without case Resolution dialog pop-up: Create a Boolean attribute, place it on form and set visible false. Create a Ribbon Command on Case using Ribbon Workbench. Create a client side script (java script) to update the Boolean flag … Continue reading

Posted in CRM, Java Script, Ms Dynamics CRM 2013, MS Dynamics CRM 2015 | Leave a comment

Save, Resolve the Case and Refresh the Form


//Save the Form Xrm.Page.data.entity.save(); //Build Request – Here the Status would be “Resolved” and Status Reason is 5 i.e. Problem Solved Pass Entity ID var request = “<s:Envelope xmlns:s=’http://schemas.xmlsoap.org/soap/envelope/’>&#8221; + ” <s:Body>” + ” <Execute xmlns=’http://schemas.microsoft.com/xrm/2011/Contracts/Services&#8217; xmlns:i=’http://www.w3.org/2001/XMLSchema-instance’>&#8221; + ” <request … Continue reading

Posted in CRM, Java Script, Ms Dynamics CRM 2013, MS Dynamics CRM 2015 | 1 Comment

MS Dynamics CRM 2013: Disable the ‘+’ icon on Sub-Grid based on Status Reason


Scenario: Disable the “+” icon on the sub-grid. I.e. Disable “+” icon on the Budget entity’s sub-grid (Funds) when the Budget records status reason is “Approval Pending” or “Approved”. Solution: 1. Download and Import the Ribbon Work Bench solution 2. Add … Continue reading

Posted in CRM, Java Script, Ms Dynamics CRM 2013 | Tagged , , , , , , , | 8 Comments