Home › Dynamics 365 Customer Engagement (CRM) › Posting Customizations Causing Page Refresh in Dynamics 365
Dynamics 365 Customer Engagement (CRM) · May 12, 2019 · 2 MIN READ

Posting Customizations Causing Page Refresh in Dynamics 365

In Dynamics 365, when a developer publishes a customization, users may see a page refresh. This piece of code appears to be specific to using legacy forms.

We will demo this with the Account form. Go to the account, and press F12 to open the developer tools:

Search for _metadatacacheversion:

Open the JsProvider.ashx version (other files may run during other circumstances). Click the curly braces to Pretty Print the file so it is readable:

Now, where the _metadatacacheversion line is, add a breakpoint in that block:

Now make an update to the account and save it. The debugger breakpoint will be hit. You will see the $v_A and $v_B variables are being set:

In the console, check the values. I have:

$v_A
5041419
Mscrm.InlineEditDataService.get_$1Y()
5041419
$v_B
“5511504”
Mscrm.InlineEditDataService.get_$1n()
“5511504”

You can see in the code, a comparison is done to see if any values have changed by comparing against two functions.

Now, let’s make a code update. I will add a field to a form, save and publish:

Now change a value on the account form (without refreshing the form) and save. The debugger will hit the breakpoint and you will see the values for our variables have changed:

As a result, you will see window.location.reload(true) run and the form will try to reload:

You will see a message like, “Changes you made may not be saved”:

Clicking Reload will reload the page and grab the latest changes from the server.

As noted, when using legacy forms this appears to be more obvious.

 

Carl de Souza
Keep learning. Keep building.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.

Subscribe on YouTube →
Carl de Souza Enterprise Architect at Microsoft · AI Technology Expert

Leave a Reply

Your email address will not be published. Required fields are marked *

Carl de Souza
KEEP LEARNING. KEEP BUILDING.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.