knowledgecenter-breadcrum

Knowledge Center

01 Oct, 2026

Automatically Refresh a PCF Dataset Grid After Closing a Custom Page in Dynamics 365

Posted on 01 Oct, 2026 by Trupti Nikumbh, Posted in PCF (PowerApps Component Framework) Power Platform

Blogs

Introduction

Custom Pages provide a modern way to edit records in Dynamics 365. A common approach is to open a Custom Page from a PCF Dataset Grid, allowing users to update records without leaving the current page.

However, after saving the changes and closing the Custom Page, you may notice that the PCF Dataset Grid still displays the old data. The user has to manually refresh the page to see the latest changes.

In this blog, we'll see why this happens and how to fix it with a simple solution.

The Problem

Suppose you have a PCF Dataset Grid with a button that opens a Custom Page.

The user:

  1. Opens the Custom Page.

  2. Updates a record.

  3. Saves the changes.

  4. Closes the Custom Page.

Although the record is updated successfully in Dataverse, the grid continues to display the previous values.

Why Does This Happen?

The Custom Page runs independently from the parent Model-driven form.

When a record is updated inside the Custom Page, the PCF Dataset Grid is not automatically notified that the data has changed. As a result, the grid continues displaying the cached data until it is refreshed.

Solution

The navigateTo() method returns a Promise. Once the Custom Page is closed, refresh the dataset so that the latest records are retrieved from Dataverse.

Before

Xrm.Navigation.navigateTo(pageInput, navigationOptions);

The Custom Page opens successfully, but the grid is not refreshed after closing it.

See Grid

After

Xrm.Navigation.navigateTo(pageInput, navigationOptions)
.then(() => {

    context.parameters.dataset.refresh();

})
.catch((error) => {

    console.error(error);

});

On custom Page updated WK-1,WK-2



After Closing custom gird refreshes with actual updated value


How It Works

  • navigateTo() opens the Custom Page.

  • The .then() block executes after the Custom Page is closed.

  • context.parameters.dataset.refresh() reloads the dataset from Dataverse.

  • The grid immediately displays the updated records.

Benefits

  • No manual page refresh required.

  • Latest data is displayed immediately.

  • Better user experience.

  • Simple implementation with minimal code changes.

  • Keeps the PCF Dataset Grid synchronized with Dataverse.

Conclusion

When records are edited through a Custom Page, the changes are saved successfully, but the PCF Dataset Grid does not refresh automatically. By refreshing the dataset after the Custom Page closes, users can instantly see the updated data without refreshing the entire page.

A small change like calling context.parameters.dataset.refresh() after navigateTo() significantly improves the overall user experience and keeps your PCF controls up to date.

Comment

This is a Required Field

Loading

Recent Updates

Blogs
01 Oct, 2026

Catch Blocks That Actually Catch: Logging Failed Steps in Power Automate

Introduction Most teams building Power Automate flows eventually land on the same pattern: wrap your business logic in a Scope,…

READ MORE
Blogs
23 Sep, 2026

How to Dynamically Switch Business Process Flow When Changing Forms in Dynamics 365

How to Dynamically Switch Business Process Flow When Changing Forms in Dynamics 365 Introduction Microsoft Dynamics 365 provides powerful customization…

READ MORE
Blogs
22 Sep, 2026

How to Create a Flyout Button with Multiple Actions on a Form in Dynamics 365

How to Create a Flyout Button with Multiple Actions on a Form in Dynamics 365 Introduction In model-driven apps, command…

READ MORE