Skip to main content

Posts

Showing posts from May, 2017

Get lookup control of editable grid in Dynamics CRM 2016 using JavaScript

A look up control value of the editable grid can be captured using JavaScript. One thing to note, always check Pass execution context as the first parameter shown in below image. Without this you won't be able to work on editable grids. Editable grids doesn't work in the Xrm.Page context. Handler properties of Editable Grid Your javascript web resource will have following code. In code below, look up value is being checked and based upon that other controls in the grid will be disabled. function gridDisableEstimatesOnStatusChange(executionContext) { var entityObject = executionContext.getFormContext().data.entity; var statusValue = entityObject.attributes.getByName('##lookup control logical name##').getValue(); if(statusValue != 0) { var estimateControl = entityObject.attributes.getByName('##control's logical name##').controls.get(0); estimateControl.setDisabled(true); // Set value of any other control ...

Bind JQuery datatable dynamically with a button in the grid

Whenever we bump into the requirement to show custom data (fetched from database or external application) on HTML using JQuery, its datatable control can be used. JQuery datatable has inbuild features like pagination and auto complete search. It's quite simple to implement them. Below sample shows how to bind dynamic data to JQuery datatable with a button control in the grid. Your HTML code: Your Javascript : Javascript Code Output: Output thanks p.