Sonoma Partners Microsoft CRM and Salesforce Blog

Dynamics 365 Editable Grids

As with any release, the recent release of Dynamics 365 has introduced a bunch of new features.  Head over to the CRM Roadmap site, or the CRM What’s New site to see first hand the features that have recently gone live.  In this blog we’ll talk about one of those new features we’re really excited to see get added to the project:  Editable Grids.

Editable Grids

One of the most sought after features since I’ve been working on Dynamics CRM is editable grids.  The mantra of Dynamics CRM for the past 15 years has been read only lists/views, and a single record form to modify the data.  In most of our implementations, we’re asked to create an editable grid to allow users to more quickly modify data.  We even took our client specific editable grid solution, made it generic, and provided a free version of it for Dynamics CRM 2011/2013/2015/2016 for the community to download from our tools site.

However, Microsoft has released the ability to turn any grid in Dynamics CRM into an editable grid with their latest release of Dynamics 365 for Sales.  Upon this announcement, I believe I heard all of the developers at Sonoma Partners let out a loud cheer as working with editable grids is a pretty challenging task.

Note that this new editable grids functionality is available for sub grids (that appear on forms) as well as home grids (the grid that shows when you select an entity from the Site Map, or when you expand a sub grid on a form to be full sized).  And as you can see below, editable grids are supported on the web, phone and tablet clients.

What’s supported on the editable grids?  Is everything you’re used to with a read only grid and record form supported?  The quick answer is that yes, everything you can do with a read only grid you can do with an editable grid (plus more):

  • In line editing
  • Sorting
  • Grouping (see below)
  • Filtering
  • Pagination
  • Calculated and Rollup Fields
  • Run time resize/move columns (see below)
  • Auto Save / Manual Save (see below)
  • Toggle between read only and editable grid (see below)
  • Filtered lookups
  • Chart panel interaction
  • Command bar interaction
  • Business Rules (e.g., show error messages, set field value, set business required, set default value, lock or unlock)
  • JavaScript

Enabling Editable Grids – Home Grid

To enable the editable grid for a home grid, first go to customizations for the entity at Settings –> Customizations –> Customize the System –> Entities, and then click on the Controls tab for an entity you want to configure.  In my example below, I’m working on the Account entity.

image

By default, the Web/Phone/Tablet will all be using the legacy read only grid.  However if you click on the Add Control link, you can select the Editable Grid control in the dialog that pops up, and click on Add.

image

You’ll then have the option to enable the editable grid for the Web, Phone, and/or Tablet experiences by selecting the appropriate radio buttons.  For now, we’ll just enable it for the Web.

image

 

Enabling Editable Grids – Sub Grid

For a Sub Grid, navigate to the form that the sub grid is on and find the sub grid you want to make editable.  Select the sub grid on the form, and click on the Change Properties button in the ribbon.  In the dialog that appears, select the controls tab, and click on the Add Control link.  As with the main grid, you can add the Editable Grid control, and then configure in the sub grid properties dialog which form factor the editable grid applies to (web, phone, and/or tablet).  We’ll choose just Web once again for the Contact sub grid on the Account form.

image

Configuring the Editable Grid

Whether you enabled a Main Grid or Sub Grid to use the Editable Grid control, the configuration is the same.  Once you add the Editable Grid control, you’ll see an Events tab appear.  This allows you to configure JavaScript code that will trigger on certain events that occur in the grid.

image

This is very similar to the Form Properties dialog where form JavaScript libraries are configured at the form level.  The events currently exposed by the API for editable grid JavaScript libraries are:

  • OnChange (when a particular field is changed)
  • OnRecordSelect (when the user selects a record)
  • OnSave (when a record is saved)

In addition to adding JavaScript to your editable grid, when you have the Editable Grid row selected in the Controls tab, you’ll see some configurable options at the bottom of the dialog.

image

The Add Lookup link allows you to configure how a lookup will work in the grid.  You don’t have to add a configuration option for a lookup.  However, with this option, this allows you to configure filtered lookups for a specific view, just like you’re able to do on the form.  Therefore if you have filtered lookups on the form, it’s strongly recommend you configure your lookups on the editable grids via the Add Lookup link.

image

The Nested Grid View and Nested Grid Parent ID are used to display a grid within a grid.  Note that this functionality is only available on and Tablet.  Clicking on the pencil icon next to these settings will allow you to select the entity to be shown in the nested grid, along with the parent lookup field on which the related records should be fetched.

The Group by Column setting allows users to select the Group By option on the top of the grid when actually working within an editable grid.  Group By is different than sorting on a column in that it will put records into an expandable control based on the field that you have grouped by.  Only the fields in the current view will be options in the Group By dropdown.  Groups can be expanded or collapsed.

image

Using the Editable Grid

After you have your grid configured, your users can simply click into a field to be able to edit the value in the field without opening the record form.  You can also quickly change fields via the keyboard (tab) or mouse.

To save the updates you made to the record, you can simply click off to another record, or click on the Save icon in the top right corner of the grid.

image

Users can also change the grid between the new editable version shown above, and the classic read only version via the Show As button in the toolbar.

image

Also note that the columns in the grid can be reordered per user per view.  The column order, group by setting and sort order is persisted throughout the application until the user clears their browser cache.

Considerations

With the new editable grid functionality, there are a handful of tips and considerations to think about as you’re configuring your CRM deployment.

  • The Editable Grid doesn’t respect read-only fields on the form since that isn’t a legitimate way to control security.  To prevent users from editing these fields, you’ll need to either add field level security to the field, not put that field in the view, or write JavaScript (this will be covered in a future developer related blog post).
  • The Editable Grid version of a sub grid takes up more space than the read only grid (especially if you enable the Group By feature).  Allow for a larger sub grid to make sure your users see the same amount of data they used to.
  • Enabling editable grids on a home grid is a global setting meaning that wherever you see that entities home grid it’ll show as an editable grid (e.g., tiles clicked from anywhere on the Site Map, sub grids that are expanded to the full grid).
  • Enabling editing on a sub grid is a per sub grid basis meaning that every sub grid on every form and dashboard must have their editable setting enabled individually.  You could have the situation where the sub grid doesn’t have the editable grid enabled, but the home grid for that sub grid does have the editable grid enabled.  In this scenario, if the user clicks to expand the sub grid to the full grid, they’ll go from a read only grid to an editable grid.
  • Some fields are not editable in the editable grid:
    • Fields from related entities
    • StateCode
    • Customer fields (e.g., on an Opportunity or Case)
    • Composite fields
    • Party List fields (e.g., the To field on an Email)
    • Field Level Secure fields (if your field security profile prevents you from editing the field)
Topics: Microsoft Dynamics 365 Microsoft Dynamics CRM Microsoft Dynamics CRM Online