I am having trouble with users forgetting to save within an editable subgrid. I would like to be able to save and refresh an editable subgrid with javascript so that I can add it to the on save event for the form.
Is this possible, I did not see it in any of the current documentation?
Thanks in advance!
*This post is locked for comments
you can also try by using a JS web resource by adding a event handler on main form save , calling a function
function refresh(executionContext) {
var formContext = executionContext.getFormContext();
formContext.ui.refresh();
}
Hi, did you find any solution to this? I am facing a similar issue.
Hi i have added code on onchange event of subgrid to setvalue of column but the problem is on setvalue it just displays value in column but on page refresh it discard changes. The main problem is crm subgrids are not exposing its save method to users and i need to bypass it
function SaveSubGrid(eContext)
{
var nameAttr = eContext.getEventSource();
var attrParent = nameAttr.getParent();
var InstructionFieldChield = nameAttr.getValue();
var InstructionFieldParent = InstructionFieldChield;
nameAttr.setValue(InstructionFieldParent)
Xrm.Page.data.entity.save();
attrParent.attributes.get("aga_anwendungshinweis").setValue(InstructionFieldParent[0].name);
}
Hi,
Why not using the OnChange event within the editable grid ? as Mahadeo suggested : msdn.microsoft.com/.../mt788311.aspx
Everytime the value change, you save it (it's a bit big for process but ...).
If you want to make sure that the changes are always saved i assume that's the way to go.
Clément
Hi did you find any solution on this?
I am facing similar issue and no workaround i found till now.
Thank you for the response but unfortunately this does not help either. For example the user edits a value in the subgrid and then clicks back to the main form it will not save the subgrid edit. Then if the user either manual or auto saves the main form it will lose the information that they changed in the subgrid.
Really I just need a way to save the subgrid with JS so that I can add it to the onSave event of the main form.
Hi,
Autosave is supported for editable grids.
neilparkhurst.com/.../dynamics-365-editable-grids/
In order to refresh the subgrid, you could use the code below.
var subgrid = Xrm.Page.ui.controls.get("subgridname"); subgrid.refresh();
See: community.dynamics.com/.../148240
Hope this helps.
I have looked at these and have some JavaScript functions working with editable grids but unfortunately I cannot find a way to save the items in the editable subgrid with JavaScript.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156