cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tvd_nzi
Advocate II
Advocate II

PCF control initializes before full form load and doesn't trigger updateView

Hi all

 

We've already a ticket open at microsoft and I'm now curious if any of you ever faced this issue.

 

We developed a pcf control with react which formats and validates phone numbers bound to standard phone fields. Only on the production environment (fastest environment, approx. 2k users daily) we have the issue that in some cases the pcf control doesn't receive any props (phone number and iso code for formatting) when the form has fully loaded. UpdateView just doesn't get called anymore and due to a mistake in react pattern phone numbers got overwritten with null. We fixed this:

 

private _numberChanged(newNumber: string) {
        if (newNumber !== this._properties.initialNumber) {
            this._value = newNumber;
            this._notifyOutputChanged();
        }
    }

 

but now the users cannot tell if this record has a phone number or not, possibly generating overhead when they realize the phone number is missing and have to look it up. The pcf control follows best practice, there are no known anti-patterns used. 

 

So to us this seems to be a platform/framework issue due to some strange race conditions as it only happens on the fastes environment. We could never reproduce the issue on any other environment or customer.

 

Any ideas? Any hints?

 

Thanks in advance!

5 REPLIES 5
cchannon
Memorable Member
Memorable Member

I've never seen that happen in a PCF, but if your problem is simply that updateView isn't getting called for some reason, you could just add a bit of formscript that runs onload and calls fireOnChange. That ought to force updateView to fire.

HemantG
Power Apps
Power Apps

Please DM me the ticket number and share the control . This seems like a bug . 

 

 

hemant 

Hi cchannon, this would be considered a workaround and doesn't work either. AddOnChange is not called when form initializes.

rbuljevic
Advocate I
Advocate I

Did you get some meaningful reply?

This really is an issue as you cannot distinguish between 2 very different cases:

  • a bound field is not yet loaded on the form and therefore null
  • a bound field is loaded but is empty and therefore null

With PCF updateview you cannot distinguish between those two and that can be a huge issue in practice

We do not encounter this issue anymore. It occured only on one environment which is also the production and most fastest. Microsoft never acknowledged this bug and the issue "resolved itself" for us. You can contact microsoft support though but be aware, you need to reproduce the issue everytime otherwise Microsoft will let you wait.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,082)