web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Subgrid not refreshing after save in Dynamics 365 On-Premise v9.1.43.5

(0) ShareShare
ReportReport
Posted on by 2
Environment
-----------
Product: Microsoft Dynamics 365 On-Premise
Version: 9.1.43.5
Browser: Chrome (latest)
Entity: Survey (schema name: contact — custom entity)
Subgrid: SurveyGeographicLanguage 

Issue Summary

-------------
When a user saves the Survey form, the "Survey Display Languages " subgrid does not display newly created language records (e.g. US-English, US-Spanish) until the page is manually refreshed (F5 or hard refresh).

The data IS being saved correctly to the database — confirmed via Advanced Find. The issue is purely a UI rendering problem where the subgrid does not refresh after save.

This issue does NOT occur in v8.2 where the same code works correctly.

Plugin Details

--------------
Plugin Name: CreateUpdateMultiSelectSurveyOptions
Registration: Post-Operation, Synchronous, Update message
Entity: contact (Survey)
The plugin reads abc_surveygeographicscope JSON field and creates abc_surveygeographicscopelanguage child records after save.

Console Error (Existing Platform Bug)

--------------------------------------
The following error appears in the browser console on every save:

jQuery.Deferred exception: Failed to execute 'evaluate' on
'XPathEvaluator': parameter 2 is not of type 'Node'.
TypeError: parameter 2 is not of type 'Node'.
at Object.SelectSingleNode (global.ashx:6872)
at Mscrm.DataSetObjectInputs.get_$2K_0 (DataSetControl.js:5004)
at Mscrm.DataSetObjectInputs.getParameter (DataSetControl.js:5020)
at Mscrm.DataSetObjectInputs.get_viewId (DataSetControl.js:4987)
at DataSetControl.js:2031

This error originates from CRM internal files (DataSetControl.js and global.ashx) — NOT from custom code. This crash appears to kill the entire save event chain preventing any programmatic subgrid refresh from executing.

Root Cause Analysis

-------------------
1. v8.2 performed full page reload after every save — subgrids automatically re-fetched data on reload.

2. v9.1 introduced Single Page Application (SPA) model — form no longer reloads after save. Subgrids must be explicitly refreshed programmatically.

3. The XPathEvaluator crash in DataSetControl.js blocks all CRM save event APIs from executing correctly in v9.1.43.5.

 
 
What We Have Tried
-----------------

Attempt 1 — subgrid.refresh() in OnSave
Code: Xrm.Page.ui.controls.get("SurveyGeographicLanguage").refresh() Called directly inside existing Survey_OnSave function.
Result: FAILED — XPathEvaluator crash occurs. Fires before plugin creates child records anyway.

Attempt 2 — setTimeout with 1500ms / 5000ms delay
Code: setTimeout(function() { subgrid.refresh(); }, 1500);
Result: FAILED — Race condition. XPathEvaluator crash still occurs regardless of delay duration.

Attempt 3 — formContext.data.addOnPostSave
Code: formContext.data.addOnPostSave(callbackFunction);
Result: FAILED — API not available in v9.1.43.5.
Error: TypeError: formContext.data.addOnPostSave is not a function

Attempt 4 — formContext.data.entity.addOnSave
Code: formContext.data.entity.addOnSave(callbackFunction);
Result: FAILED — Callback registers successfully but never fires.
DataSetControl XPathEvaluator crash kills the save event chain before callback can execute.
Console confirmed: "addOnSave registered" log appears but "callback fired" log never appears.

Attempt 5 — formContext.data.refresh() then subgrid.refresh()
Code: formContext.data.refresh(false).then(function() {
subgrid.refresh();
});
Result: FAILED — Same XPathEvaluator crash blocks execution.

Attempt 6 — Flag Field + addOnChange

Approach: Created new Boolean field abc_subgridrefreshflag on
Survey entity. Modified plugin to toggle this flag after creating child records. JS listens for field change via addOnChange.
Result: FAILED — CRM v9.1.43.5 does not push server-side field updates to the currently open form. addOnChange never fires.

Attempt 7 — addOnSave + Xrm.WebApi Polling
Approach: Used addOnSave to start polling Xrm.WebApi every 1.5 seconds to check if child records exist, then call subgrid.refresh().
Result: FAILED — addOnSave callback never fires due to DataSetControl crash blocking save event chain entirely.
Categories:
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    669 on at
    In Dynamics 365 On-Prem v9.1.43.5, the subgrid not refreshing after save is caused by a known platform issue in the legacy web client where a DataSetControl.js
     
    XPathEvaluator error breaks the save event pipeline.
     
    Because of this, all standard approaches like OnSave, addOnSave, or delayed refresh fail.
     
    The only reliable solutions are to bypass the save event entirely by using a custom ribbon button that performs save and then refreshes the subgrid, or by forcing
     
    a full page reload after save.
     
    Timer-based polling or moving logic to a custom action are also viable alternatives depending on your architecture.
     
    what I would do
    Implement:
    • Custom Ribbon Button: "Save & Refresh"
    • Hide default Save button (optional)
    • Add 2-second delay before refresh

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 130

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 77 Super User 2026 Season 1

#3
Martin Dráb Profile Picture

Martin Dráb 54 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans