Dynamics 365: Editable grids and autosave

By | April 14, 2017

For a little while now, Dynamics has been offering editable grids. Having this functionality in Dynamics had been a dream for many of us – it makes a lot of things so much easier. After all, we can finally provide that great user experience where users can edit everything they need on the same screen.

However, there was a discussion recently where somebody mentioned that autosave does not work for editable grids:

https://community.dynamics.com/crm/f/117/p/233867/639316

And indeed, it does not. You can change something in the editable grid, close the form, and you will lose your changes as a result. Which is different from how it works for other, non-grid fields.

I did a bit of research and found this article:

https://msdn.microsoft.com/en-us/library/mt788311.aspx#BKMK_OnSave

Some important points to consider for the OnSave event:

  • If a user edits multiple columns of the same record in sequence, the OnSave event will only be fired once to ensure optimal performance and form behavior compatibility.
  • Editable grid and the parent form have separate save buttons. Clicking the save button in one will not save changes in the other.
  • Editable grid does not save pending changes when navigation operations are performed outside of its context. If the control has unsaved data, that data may be lost. Consequently, the OnSave event may not fire. For example, this could happen when navigating to a different record using a form lookup field or through the ribbon.
  • Pressing the refresh button in the editable grid causes it to discard any pending changes, and the OnSave event won’t be fired.
  • Editable grid control does not implement an auto-save timer.
  • Editable grid suppresses duplicate detection rules.

So.. it seems to be a bug? It’s sort of difficult to call it a feature, but, on the other hand, it’s definitely a known bug.

 

It seems there is no workaround, at least there is no supported workaround. Problem is, editable grid does not expose any sort of “save” or “set selection” method, so there seem to be no supported way to force it to save the updated data.

Leave a Reply

Your email address will not be published.