Category Archives: JavaScript

Design Auto Complete Text controls in Dynamics CRM 2016

Introduction: On Dec 1st Microsoft released another great version of Dynamics CRM – CRM 2016 that has loads of new features and not to forget developer enhancements too. One of the developer enhancements added to Dynamics CRM 2016 is “Auto Complete” which allows us to provide auto complete feature for the single line text fields.… Read More »

Identify the trigger for an On-load event for Sub-grid in Dynamics CRM

Introduction: With CRM 2015 SP1, the Client API was extended to allow attaching events to sub-grid to manage the sub-grid data/operations. The OnLoad event however executes on all of the following operations Load of parent form. Save of parent form. Add a new record in sub-grid Remove a record from sub-grid Navigating to prev/next page… Read More »

API functions to control Subgrid behavior starting Dynamics CRM 2015 Update 1

Introduction: Prior to CRM2015 update 1 the only available function for interacting with the subgrids on the form was refresh(). This function is used to refresh the sub-grid records. With the release of CRM 2015 update 1, more functions were introduced to interact with the sub-grid using JavaScript. Function list: 1. addOnLoad 2. removeOnLoad Use… Read More »

Make Cross Domain Web Service Request through Client Side Scripting in Dynamics CRM

To perform CRUD operations with CRM data at client side we use ODATA and SOAP services of Microsoft Dynamics CRM. We use XMLHttpRequest to send request to these services to get the response. Microsoft Dynamics CRM provides below WCF services that we used to manipulate CRM data, Organization Data Service – Protocol:  OData (REST) http://<server>/XRMServices/2011/OrganizationData.svc/… Read More »

Passing special characters For Odata request using JavaScript in Dynamics CRM 2015

To retrieve records from Dynamics CRM using JavaScript one of the popular options is using CRM Odata services using REST endpoint. There are many situations occurs when we need to retrieve records from CRM by name using REST retrieve multiple request. For example in below script we are retrieving products by product name. While passing… Read More »

Lock/Unlock Composite fields using Java Script in Dynamics CRM

Traditionally we use the following way to lock or unlock the fields programmatically, Xrm.Page.getControl(fieldname).setDisabled(true/false); But there could be some cases where we would need to lock/unlock the composite fields programmatically. For example, consider the following scenario, Suppose that we are populating the Bill To address on Quote as the address of the customer selected on… Read More »

Set Address using Lookup Address for locked Address fields in Dynamics CRM

Recently, we had a request, the request is like this, Bill-To address and Ship-To address on the Quote would be locked fields. This means, one way of setting the Bill-To and Ship-To is by using Lookup Address button. So, initially we thought it would be a Cakewalk. We wrote a script and called it on… Read More »

Apply Custom Filter on Lookup Field in Dynamics CRM using Script

Introduction: In this blog, we are going to see how to apply a custom filter to the lookup field using the JavaScript functions. Microsoft Dynamics CRM allows us to filter a lookup field on the form using the Fetch XML condition and “addPreSearch()“ method. Example: On the Contact Entity, there is a lookup field named… Read More »

Applying Scripts on Business Process Flow controls in Dynamics CRM 2015

Introduction Anyone who would have tried using the api functions available to access the controls on the Business Process Flow to hide/lock in CRM 2013 would know that the function only worked if the control was on the current active stage on the form. Suppose you had 2 stages Develop and Propose and you had… Read More »