Recently, while diving deep into the newly introduced virtual PCF component, I faced an issue where the PCF control wasn’t loading the data on the 1st load of the page.
Let’s have a look at the issue first. As seen in the below screenshot, I have added our PCF control on the First Name field. Kindly refer to this blog to have a look at it as well. Here you can see that the contact does have a first name, but isn’t being rendered in our control.
This happens, because as per my observation the PCF controls end up loading first before the full form is loaded which causes an issue while loading the default values. So to overcome this, I will use a property that is passed through context known as isPropertyLoading.
As per my observation, isPropertyLoading will return true until the form is completely loaded and the context can get actual field values instead of null.
So I will add a conditional rendering based on the isPropertyLoading property. Where I will render our component…