Use of async-await in virtual PCF control


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:…


Source link

More About This Author

Inogic
Inogic is one of the leading Microsoft Dynamics 365 ISV since 10+ years. Its flagship product Maplytics™ is a market leading certified (CfMD) geo-analytical mapping app. Maplytics empowers Dynamics CRM users across industries with the power of geographical data visualization, route optimization and along the route search with turn-by-turn directions, appointment planner, locational search by radius and shapes with drill-down filters and color-coded pushpins, heat maps, shape layers & territory management.
 
Inogic is renowned for its high quality and low-cost offshore development services and productivity apps like InoLink: QuickBooks + Dynamics CRM, User Adoption Monitor, Attach2Dynamics, Alerts4Dynamics Click2Export, Click2Clone, Kanban Board, SharePoint Security Sync, Lead Automation & Distribution, Map My Relationships, Auto Tax Calculator, Subscription and Recurring Billing and Marketing4Dynamics.

Author: Inogic

Inogic is one of the leading Microsoft Dynamics 365 ISV since 10+ years. Its flagship product Maplytics™ is a market leading certified (CfMD) geo-analytical mapping app. Maplytics empowers Dynamics CRM users across industries with the power of geographical data visualization, route optimization and along the route search with turn-by-turn directions, appointment planner, locational search by radius and shapes with drill-down filters and color-coded pushpins, heat maps, shape layers & territory management.   Inogic is renowned for its high quality and low-cost offshore development services and productivity apps like InoLink: QuickBooks + Dynamics CRM, User Adoption Monitor, Attach2Dynamics, Alerts4Dynamics Click2Export, Click2Clone, Kanban Board, SharePoint Security Sync, Lead Automation & Distribution, Map My Relationships, Auto Tax Calculator, Subscription and Recurring Billing and Marketing4Dynamics.

Share This Post On
Share via
Copy link
Powered by Social Snap