The much-awaited capability of editing a CRM grid inline is one of the new features in Dynamics 365. Using this functionality improves the productivity of the CRM user by significantly reducing the number of mouse clicks.
Editable grid is available as a UI control which can be added to an entity through entity customization. Addition of the editable grid to the desired entity will make all the entity views for that entity inline editable allowing the users to make in-place updates to the values of the grid view columns. The editable grid control also enables a very useful feature to group the records in the view by selected view columns. Using form customizations, this control can also be added to the subgrids on the form enabling them for inline edits.
To interact with the editable grid developers can write scripts which can be executed on the following grid events.
- OnChange
- OnRecordSelect
- OnSave
The following table details out several editable grid methods to access the grid control elements and their values programmatically.
Method |
Description | Implementation |
Grid Methods |
||
getGrid() | – Returns the grid object
– Contains information about all the grid elements |
![]() |
getRows() | – Returns an enumerable collection of data row of the grid
– Contains information about the row elements of the grid – Returns all the rows displayed on the UI |
![]() |
getSelectedRows() | – Returns an enumerable collection of selected data rows of the grid
– Returns data related to one or more rows selected on the UI |
![]() |
getTotalRecordCount() | – Returns the count of the number of rows in an entity view |
|
Grid Row Methods |
||
getData(),
getKey(), getData().getEntity(), getData().getEntity().getEntityName(), getData().getEntity().attributes |
– Returns an object of the row data specific to the record displayed/selected in the grid
– Contains entity information, attributes information and related entity information – Attributes returned are limited to the columns presented in the editable grid |
![]()
|
Grid Cell Methods |
||
setNotification(),
clearNotification(), getName(), getLabel() |
– Each grid cell is associated with a UI control like text, lookup, picklist
– Information related to these control is available in the attribute collection – These controls can be accessed in a similar way as on the entity form |
|
Hope you find it useful, stay tuned for more updates.
Thank you,
Swaroop Deshmukh
Lead Dynamics CRM Consultant @ Adisys
Can you just give examble how to deal with the cell
rowData.getAttributes().getByName(Work_Order_Fields.F_WORK_ORDER_NUMBER).controls
returning null
i tried
rowData.getAttributes().getByName(Work_Order_Fields.F_WORK_ORDER_NUMBER).getControls()
also return null
Hi Abood,
Refer to the Grid Cell methods in the article above.
To get a cell value you can try this –
editableGrid.getSelectedRow().getAll()[0].getData().getEntity().attributes.getByName(“attributeName”).controls.getByName(“GridColumnName”);
This code will give you the value of the cell/column.
Let me know if this works for you or any further questions.
Best,
Swaroop
Thank you
this works for me