cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Refreshing subgrid send wrong data to PCF dataset control

Maybe this is an unsupported scenario but this is how I am testing my PCF dataset control for NN relationship.

 

So, my control allows to represent all available records for a NN relationship as checkboxes. User can tick the checkbox and it associates records. They untick the checkbox to disassociate records.

 

To check that everything works as expected, on my form, I added the same subgrid twice, one with my PCF control, one with standard subgrid. This way, I can check quickly if records are correctly associated.

 

The problem I found is that refreshing the standard subgrid triggers the updateView method of my PCF but the method receive the records that were visible in the standard subgrid before the manual refresh, but not the ones actually associated. 

Let me be more specific : I'm loading my form and can see two checkboxes ticked in my PCF control and two records associated in the standard subgrid.

 

If I untick one checkbox, it disassociates the record. The subgrid is not automatically refreshed (should it be? do I have to do something to force it being refreshed?). If I refresh manually the subgrid, the updateView method is triggered with both records : the one still associated and the not associated anymore but that was visible in the subgrid before the manual refresh.

 

It seems like a bug to me (unless I should do something on my PCF to force the other subgrid to refresh automatically): the updateView method should receive only the records effectively associated.

 

Any thoughts?

3 REPLIES 3
Highlighted
New Member

Re: Refreshing subgrid send wrong data to PCF dataset control

Hi @TanguyT . I'm seeing the exact same issue. Did you find any solution in the meantime? 

I have built in a refresh function on my Control (refreshing the dataset) and when I press it 2-3 times after disassociating records, suddenly the correct data appears. Until then I Can see in Debugger that the dataset is actually receiving associated records which are not associated anymore.

First I thought it was a Timing issue as my disassociation Operation is running somewhat asynchronous, but it isn't Timing. The same behavior Can be seen if you wait some time before refreshing the Control.

Highlighted
New Member

Re: Refreshing subgrid send wrong data to PCF dataset control

I resolved it by not relying on the data set refresh but by querying the data directly using web api after associate / disassociate finished. Works like a charm.

Highlighted
Solution Sage
Solution Sage

Re: Refreshing subgrid send wrong data to PCF dataset control

It's probably worth emphasising something that was mentioned when the TSQL interface was announced in preview.

 

The TSQL dataset comes from a readonly Azure SQL replica of your PowerApp database. What wasn't said but is obvious when you watch things is that read requests come from a readonly Azure SQL replica and that means there is now a slight delay between a record being updated and the change being reflected across all the replicas.

 

The time you would really notice this is when deploying and testing a plugin (I find I need a 15-30 second delay between deployment and testing to be sure the new version of the plugin is being ran) and I can see why retrieving a view would have the same impact. 

 

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (6,175)