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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Custom Page Not Loadin...
Power Apps
Unanswered

Custom Page Not Loading Latest Data

(0) ShareShare
ReportReport
Posted on by 7

I have a model driven app that is loading a custom page using the navigateTo method as seen below:

this.openCostGrid = async (formContext) => {

 const id = (formContext.data.entity.getId() || '').replace(/[{}]/g, '');
 const [{ id: draftId }] = formContext.getAttribute('new_draftid').getValue() || [{}];
 const draftRecord = await Xrm.WebApi.retrieveRecord('new_draft', draftId, '?$select=_new_costmodel_value');
 const costModelName = draftRecord['_new_costmodel_value@OData.Community.Display.V1.FormattedValue'];
 
 var pageInput = {
 pageType: 'custom',
 name: 'new_costtable_02724',
 entityName: 'new_draft',
 recordId: id,
 };
 var navigationOptions = {
 target: 2,
 position: 1,
 width: { value: 100, unit: '%' },
 title: `Cost Model: ${costModelName}`,
 };
 Xrm.Navigation.navigateTo(pageInput, navigationOptions)
 .then(function () {
 // Called when the dialog closes
 })
 .catch(function (error) {
 console.log(error);
 });
 };

 

Inside the custom page/canvas app editor, I have the following code running in the OnStart event:

Refresh('Drafts');
Refresh('Options');
Set(
 varRecordId,
 If(
 IsBlank(Param("recordId")),
 GUID("ad39b0f2-df2b-ee11-bdf4-00286423655c"),
 GUID(Param("recordId"))
 )
);
Set(
 RecordItem,
 LookUp(
 'Options',
 'Option' = varRecordId
 )
);
Set(
 DraftItem,
 LookUp(
 'Drafts',
 'Draft' = GUID(RecordItem.'Draft'.'Draft')
 )
);
Set(
 varCostModelName,
 DraftItem.'Cost Model'.Name
);

 

From the entity that is launching the custom page, I am retrieving a parent record of Draft and on the draft is a field for Cost Model.

 

The issue I am seeing is as follows:

When I open the custom page for the first time using a button on the Option form, everything works fine and the custom page displays the correct value for the cost model. If I then close the custom page modal, open a new tab, edit the draft to have a different cost model, then on the original tab, without reloading, click the button to launch the custom page, again the custom page displays the old value for the cost model. Only after refreshing the page that loads the custom page/canvas app is it retrieving the correct value.

 

I attempted fix this by adding the refreshes at the top of the OnStart event, but that did not fix the issue.

Categories:
I have the same question (0)

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 Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard