While working on a Microsoft Power Platform and Dynamics 365 solution, customization and extensibility are key to tailor fit the applications for your business needs. Amongst the many available ways, the most common ones are by using PCF Controls (PowerApps Component Framework) and Dataverse Plugins. Both options allow for creating rich, interactive experiences, but they serve different purposes and have distinct advantages.
In this blog post, we will explore the differences between PCF Controls and Dataverse plugins and list a few key considerations as you make the decision for your next project.
PCF Controls
The PowerApps Component Framework (PCF) is a framework that enables developers and app makers to build custom controls using web technologies for Model-Driven, Canvas Apps and Power Pages. These controls enhance the user experience when working with data on forms, views, dashboards, interactive widgets and canvas app screens resulting in a rich and dynamic experience.
If the logic you need to implement is tied directly to the UI and should run in the browser (on the client-side), PCF controls are a great choice. For example, you can:
- Replace a column in a form that displays a number to a slider or rating component
- Custom date picker or calendar
- Multi-select optionset
- Interactive drag and drop elements
- Hierarchy navigation tree
Dataverse Plugins
A plug-in is a custom event handler that executes in response to a specific event raised during processing of a Microsoft Dataverse data operation. The plug-in is implemented as a custom class compiled into a .NET Framework assembly that can be uploaded and registered with Dataverse. When the target event is triggered by a data operation, the code within the registered plugin gets executed and allows handling of complex business logic.
Plugins are ideal when your logic needs to be executed on the server and not dependent on the user interface. This could include operations like data validation, automation, workflow enforcement, or external system integrations. For example, you can:
- Task creation on case creation
- Order total calculation
- Case Escalation
- Invoice due date calculation
- Integrate with external system for data manipulation
- Auto number generation
PCF Controls vs. Dataverse Plugins: Key Features
Feature
Purpose:
Execution Location:
User Experience:
Performance Impact:
Complexity:
Development Language:
PCF Controls
Custom UI components for app interfaces
Client-Side (browser)
Highly interactive, rich UI components
Performance depends on client-side capabilities
Easier for UI customization, requires web development skills
JavaScript/TypeScript, React, Angular
Dataverse Plugin
Server-side logic for data operations and workflows
Server-side (Dataverse)
Logic that operates behind the scenes
Less dependent on client but server performance matters
Requires server-side knowledge and integration experience
C# (managed code)
Key Considerations for Choosing Between PCF Controls and Dataverse Plugins
When deciding whether to use PCF controls or Dataverse plugins, some of the key factors to consider based on your business requirements:
- Type of Logic
- If you are implementing business logic that needs to run based on data changes or events (e.g., before or after a record is created), Dataverse plugins are the right choice. They are ideal for backend processing.
- If your goal is to customize the user interface to provide a more interactive experience (e.g., a custom form control or visual component), then PCF controls are the way to go.
- Execution Context
- PCF controls run on the client-side, so they’re more suitable when you want to improve the front-end user experience. However, they are dependent on the user’s device and internet connection
- Dataverse plugins run on the server and are suitable for executing business logic that needs to be consistent across all clients, regardless of where the request comes from.
- Performance
- While PCF controls can enhance the user experience with rich, interactive components, they can impact the performance of the client, especially if complex operations are performed client-side.
- Dataverse plugins, on the other hand, execute on the server, which means they are less affected by the client’s performance but can impact server performance if not optimized properly.
- Extensibility
- PCF controls are generally easier to extend, especially for developers familiar with modern web development frameworks like React, Angular, or other frameworks.
- Dataverse plugins offer deep integration with the Dataverse platform and are suited for more complex operations and workflows that require server-side processing.
Conclusion
Both PCF controls and Dataverse plugins are powerful tools, but they serve different purposes. The key to choosing between them is to understand where the logic should be executed (client-side vs. server-side) and what the kind of functionality to be implemented (UI enhancements vs. backend processing). For many scenarios, you may find that a combination of both solutions provides the best results. For example, you might use a PCF control to collect user input on a form and then use a Dataverse plugin to validate or process that data server-side once the user submits it.
By carefully considering your business requirements, you can make well informed decision that leads to a more efficient, dynamic, scalable and maintainable customizations for your Power Platform or Dynamics 365 solution.