Recently while working on the virtual PCF control we noticed that the updateView() in the virtual PCF works in a different manner as compared to standard PCF control with async functions. In standard PCF control, the return type of the updateView() is void while in the virtual PCF the return type is react-element. So when we return the promise to the updateView() by calling the callback function in a virtual PCF control, we do not get the desired result.
Let’s take an example where we will create a virtual drop-down PCF control. We will be showing the entity attributes as options in our drop-down control. In the example below, we have created an async function GetEntityAttribute which will be responsible for getting the entity attributes to list out in our PCF drop-down control.
If we call our async function GetEntityAttribute in the updateView() as follows, we will not get the options with dropdown as shown in the below image.
UpdateView() Then:
public updateView(context:…