PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (2024)

In this course, we will learn to create a custom PCF control and implement it in Dynamics 365 CRM. The PCF / PowerApps Component Framework is used to create custom components in model-driven apps to provide an enhanced user experience for the users to view and work with data in forms, views and dashboards.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (1)

Understanding PowerApps Component Framework

PCF custom control helps the professional developers and app makers to create code components for model-driven and canvas apps to provide enhanced user experience for the users to work with data on views, dashboards, and forms. You create variety of controls with help of PCF such as converting a whole number field into a dial or slider component.

The PowerApps Component Framework works only with the Unified Interface and not with the old Web Client version of Dynamics 365 CRM. Also the PCF control is not supported for the on-premises instances.

What is the difference between PCF and Web Resources?

In PCF, unlike HTML web resources the code components are rendered as a part of the same context which eventually provides a real time user interface experience for the users.

Below are few advantages of using PCF over web resources.

  • Reusability with help of code components.
  • Optimizes for instance performance.
  • Access to a rich set of framework APIs that expose capabilities like component lifecycle management, contextual data, and metadata.
  • Seamless server access via Web API, utility and data formatting methods, device features like camera, location and microphone, along with easy-to-invoke UX elements like dialogs, lookups, and full-page rendering.
  • Bundle all files into a single solution file.
  • Support for modern web practices.

Why custom PCF control?

In Dynamics 365, there are multiple types of fields Single Line of Text, Whole Number, Currency etc. For example, in Account entity, there is a field called as “Account Number” which is a simple text field.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (2)

If we open an Account form >> navigate to Account Number field, Field Properties >> Controls. Here we can see that the current used control is a text box.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (3)

By clicking on Add Control, we can see the out-of-the-box controls provided by Microsoft as given below.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (4)

This controls are great, but there are possibilities where the type of control or UI we want is not provided in the out-of-the-box controls. This is where the PowerApps Component Framework comes in. The PCF allows us to build our own controls, which opens PowerApps controls to interesting use cases.

Create a custom PCF control

We will learn how to create a custom PCF control from scratch in Dynamics 365 CRM.

  • Install Node.js
  1. Click here to open Node.js downloader.
  2. Download the MSI file and run the downloaded msi setup.
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (5)

3. Once the installation is complete, open the Windows PowerShell and enter the below code.

node -v
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (6)
  • Download and install Visual Studio Code.

Click on the link to download and install Visual Studio Code.

  • Install Power Apps CLI
  1. Click here to download Power Apps CLI.
  2. Once downloaded the MSI file, install the Power Apps CLI as shown below.
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (7)

3. Validate the your Power App CLI is updated by entering the below code in the command prompt.

pac install latest
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (8)
  • Create a PCF Project.
  1. Create your own projection folder in your local machine as shown below.
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (9)

2. Open the Command Prompt and change the location to the folder path as shown below.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (10)

3. Enter the command in below format to create the control.

pac pcf init –namespace <specify your namespace here> –name <put component name here> –template <component type>

So in our case we will run the below code.

pac pcf init --namespace CRMCrateNamespace --name CRMCrate --template field
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (11)

4. Now, open the above created folder and validate that the project is control project is successfully created there as shown below.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (12)

5. Now enter the below command in the Command Prompt.

npm install
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (13)

Now, the above created solution contains the sample PCF Control code.

  • Develop the control in Visual Studio Code.
  1. Open the above project path in Visual Studio Code .
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (14)

2. Enter the below code in Command Prompt to run or build the project.

npm run build
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (15)

3. Now to start the project, enter the below code.

npm start
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (16)

Once you run the control project, the PCF control sandbox will get automatically opened in the internet browser as shown below.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (17)
  • Develop the custom PCF Control.

Create a new PCF project by entering the below command.

pac pcf init --namespace SampleNamespace --name TSLinearInputComponent --template fieldnpm install
  1. Open the PCF control project in the Visual Studio Code. Expand the main folder and open the file called ControlManifest.Input.xml as shown below.
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (18)

2. Update and override the default xml code with our custom code. Copy the below code and paste it in the ControlManifest.Input.xml. Later save the file.

<?xml version="1.0" encoding="utf-8" ?><manifest><control namespace="SampleNamespace" constructor="TSLinearInputComponent" version="1.0.0" display-name-key="Linear Input Component" description-key="Allows you to enter the numeric values using the visual slider." control-type="standard"> <type-group name="numbers"> <type>Whole.None</type> <type>Currency</type> <type>FP</type> <type>Decimal</type> </type-group> <property name="sliderValue" display-name-key="sliderValue_Display_Key" description-key="sliderValue_Desc_Key" of-type-group="numbers" usage="bound" required="true" /> <resources> <code path="index.ts" order="1" /> <css path="css/TS_LinearInputComponent.css" order="1" /> </resources></control></manifest>

3. Within the main folder, create a new folder called css by right clicking on main folder. Later add a new file in it called TS_LinearInputComponent.css.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (19)

Click here to copy the css code from the Microsoft link and paste it in the above created new TS_LinearInputComponent.css file.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (20)
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (21)

4. Lets write the logic, click here to open the Microsoft link and copy the code from section Implementing Standard Logic.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (22)

In Visual Studio Code, open the Index.ts file and override it by pasting the above code.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (23)

5. To build the project, enter the below code in the Command Prompt.

npm run build
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (24)

6. For debugging, enter the below command. This will open the control in the browser.

npm start

Our control is now developed, ready and visible in the browser as shown below.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (25)
  • Deploy the PCF control in Dynamics 365 CRM.
  1. We have to create a package and deploy the above created new control in our Dynamics CRM. Enter the below command to create a new folder called Solution in the your project directory.
 pac solution init --publisher-name developer --publisher-prefix dev
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (26)
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (27)

2. Now we need to add the reference to state where our component location is. Enter the below command and change the directory name as your folder name.

pac solution add-reference --path c:/YourFolderPath

3. Run the solution directory by using the below command.

msbuild /t:restore

If you find the message as “msbuild does not exist”, then you can find it in your Visual Studio directory with path such asC:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\MSBuild.exe:

Note : – you may have issues using the MSBuild located in Program Files or the .NET Framework directory, in which case use the Visual Studio directory.

Once done, again run the below code.

msbuild

This will create a zip solution file in the above created Solutions folder as shown below.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (28)

4. Now lets install this solution in the Dynamics 365 CRM by navigating to https://make.powerapps.com/ and select Solutions as shown below.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (29)

Select the above zip solution file and import the solution.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (30)
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (31)
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (32)
  • Add the imported custom control in Dynamics CRM field.

In the above steps we have created and imported our custom control solution in the Dynamics CRM. Now its time to add the control in our field. In our case, we will add the custom control in field Actual Revenue of Account entity.

  1. Navigate to Settings >> Customization >> Customize the System > > Entities >> Accounts >> Forms. Select the Actual Revenue field and click on Properties >> Controls.
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (33)
PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (34)

2. Now, we will see our above created Custom Control as shown below.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (35)

3. Select the custom control and use it as per your need as shown below.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (36)

4. Save and publish the form. Navigate to the CRM, open the Account record and validate that the field Actual Revenue is represented in the form of custom control.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (37)

Conclusion

Thus we learned how to create, import and use PCF custom control in Dynamics 365 CRM.

PCF custom control in Dynamics 365 CRM (Step-By-Step Guide) (2024)

FAQs

How do you create a PCF component? ›

Creating a new component project
  1. Open a command prompt window. ...
  2. Open your LinearInput folder inside Visual Studio Code. ...
  3. Open a new terminal inside Visual Studio Code using Terminal -> New Terminal.
  4. At the terminal prompt, create a new component project by passing basic parameters using the pac pcf init command.

How do I create a custom control in power app? ›

Alternatively, you can create a custom column. On the Column Properties page, select the Controls tab, and then select Add Control. On the Add Control page, select the control that you want, such as the Linear Slider control shown here, and then select Add. Choose the client where you want the control to appear.

What is a PCF code component? ›

Power Apps component framework empowers professional developers and app makers to create code components for model-driven and canvas apps. These code components can be used to enhance the user experience for users working with data on forms, views, dashboards, and canvas app screens.

What is difference between CF and PCF? ›

The key difference between a PCF and a CF is that the Central Bank's prior approval is not required for persons to be appointed to a CF position, but the Central Bank will be able to investigate, suspend, remove and/or prohibit a person from carrying out a CF in a regulated financial service provider in the future.

What is PCF and why it is used? ›

PCF is a cloud native platform for deploying next-generation apps. Based on open source technology, PCF enables enterprises to rapidly deliver new experiences to their customers. PCF can be deployed on-premises and on many cloud providers to give enterprises a hybrid and multi-cloud platform.

Is PCF a deployment tool? ›

PCF is a platform used to deploy next-generation apps. PCF is a cloud-native and open-source technology that can rapidly deliver experiences to end users.

What are PCF commands? ›

The purpose of IBM® MQ programmable command format (PCF) commands is to allow administration tasks to be programmed into an administration program. In this way you can create queues and process definitions, and change queue managers, from a program.

What are PCF controls? ›

A PCF (PowerApps component framework) control enables professional developers and app makers to create code components for model-driven apps and canvas apps. This helps provide an improved experience for users working with data in forms, views, and dashboards.

Is PCF a DevOps tool? ›

There are many tools available to do DevOps for PCF. Automating the deployment of artifacts to PCF is very easy and many articles have been published about it.

How do I create Power Apps in Dynamics 365? ›

Recommended content
  1. Import data in model-driven apps - Power Apps. ...
  2. Find your administrator or support person - Power Apps. ...
  3. Tables in Dataverse - Power Apps. ...
  4. Create a business process flow in Power Apps - Power Automate. ...
  5. Share a model-driven app using Power Apps - Power Apps. ...
  6. Microsoft Dataverse - Connectors.
4 Apr 2022

How do I use PCF control from PCF gallery? ›

Using PCF Gallery Code Components in Your Environment
  1. Sample controls available in the PCF Gallery. ...
  2. This will take you to GitHub. ...
  3. Next, head over to make.powerapps.com. ...
  4. Import the . ...
  5. Change Properties on the field (Classic Form Designer). ...
  6. Add Control. ...
  7. Select the control, then click Add. ...
  8. Set scope and map required fields.
3 Jan 2022

Can you give examples of apps which require custom controls? ›

Examples of custom controls are tile map editors, sound enhancers, or custom avatar creators, which enhance the app's interactivity.

What is the difference between user control and custom control? ›

The main difference between them- User Control is a page file with extension . ascx which can only be used within a single application or project But custom controls are assemblies(dll files) that can be used in multiple applications.

What are custom controls? ›

A custom control is a rectangular area on the screen of a dynpro. They are created in Screen Painter and, like all other screen objects, have a unique name. Custom controls are used to embed controls in these areas. Controls are software components of the presentation server.

Which of the following is used to create the custom controls? ›

ASP.NET allows the users to create controls. These user defined controls are categorized into: User controls. Custom controls.

What is a PCF Dynamics? ›

Power Apps Component Framework (PCF) are controls that provides a new way of visualising and working with data on your forms, views, and dashboards in Dynamics 365. These controls enable organisations to create visualisations, which enhance the user interface for reading, adding or updating information.

What is PCF library? ›

PCF Gallery is a collection of controls created with the Power Apps Component Framework. The aim of this site is to list the controls created by the Power Platform community (only controls that can be downloaded are listed).

What are code components? ›

Code components are a type of solution component, which means they can be included in a solution file and imported into different environments. More information: Package and distribute extensions using solutions. Unsure about entity vs.

How many PCF roles are there? ›

There are currently 11 prescribed CFs and 54 PCFs for RFSPs other than credit unions.

Is PCF SAAS or PaaS? ›

PCF is one example of an “application” PaaS, also called the Cloud Foundry Application Runtime, and Kubernetes is a “container” PaaS (sometimes called CaaS).

What is PCF called now? ›

Pivotal Cloud Foundry (PCF) is now VMware Tanzu Application Service.

What are the 9 domains of the PCF? ›

PCF Domains and overarching statements
  • Professionalism.
  • Values and ethics.
  • Diversity.
  • Rights, justice and economic well-being.
  • Knowledge.
  • Critical reflection and analysis.
  • Intervention and skills.
  • Contexts and organisations.
8 Feb 2021

How to configure load balancer in PCF? ›

To configure the Gorouter to use GCP load balancers:
  1. Navigate to the GCP Console and select Load balancing. ...
  2. Record the name of your SSH load balancer and your TCP WebSockets load balancer, PCF-wss-logs and PCF-ssh-proxy .
  3. Click your HTTP(S) load balancer, PCF-global- .
20 Jan 2021

How does PCF work internally? ›

How PCF works internally when deploying Spring boot project Will PCF run the Tomcat embedded in Spring boot jar or it runs its own tomcat. When you run cf push -p my/cool/file. jar (or even file. war), the cf cli extracts everything from that archive and pushes it up to CF.

What container does PCF use? ›

PCF (a.k.a. PAS, a.k.a. TAS) apps are deployed on containers, typically using Garden as the container runtime and Diego as the container orchestration engine. The components of the PCF runtime may be deployed as virtual machines, managed by BOSH, or as containers.

What server does PCF use? ›

The UAA (User Account and Authentication) Server is the primary Identity and Access Management (IAM) component within PCF. The UAA can be used by operations teams to create, configure, and manage existing and new user accounts.

What is a PCF file type? ›

A . pcf file can be profile configuration file or a configuration file for setting the client parameters in a virtual private network. The file is in INI file format and contains information about a VPN connection which is necessary for the client software, such as the username, password, tunneling port, DNS settings.

What is API endpoint in PCF? ›

The API endpoint is the server your CLI program talks to to execute the commands and obtain information.

How do you check PCF CLI logs? ›

Viewing Logs. To view logs, run the cf logs command. You can tail, dump, or filter log output.

What is Vcap_services in PCF? ›

VCAP_SERVICES. For bindable services, Cloud Foundry adds connection details to the VCAP_SERVICES environment variable when you restart your app, after binding a service instance to your app. For more information about bindable services, see Services Overview.

How do you run a PCF? ›

Open the URL for PCF Dev on PivNet using: https://network.pivotal.io/products/pcfdev. Navigate to the folder it unzipped into using PowerShell (Windows) or a Unix Terminal (OS X or Linux). Run the PCF Dev binary. This will install the PCF Dev plug-in for the cf CLI.

How do I refresh my PCF control? ›

In case you need to refresh the control because your data in dataset changed, you can simply call the dataset. refresh() method. That will call your updateView function (with the new data), and there you need to rerender anyway.

What is difference between PCF and AWS? ›

PCF and AWS are two of the most popular cloud computing platforms on the market. They both have their own strengths and weaknesses, but overall they are both very powerful platforms. One of the biggest differences between PCF and AWS is that PCF is built for smaller businesses. AWS is more suited for larger businesses.

Who uses PCF? ›

Pivotal Cloud Foundry is used by development teams to deploy applications or services that can simply switch from one cloud provider to another, and developers can easily move workloads between cloud platforms with no changes to the application or code.

What is difference between Kubernetes and PCF? ›

The key difference between the two is that Cloud Foundry comes pre-configured with an opinionated workflow, while Kubernetes offers a considerable amount of flexibility, and can be configured and extended to support virtually any workflow.

Is PCF a Microservice? ›

It's a set of heuristics to guide product engineering teams towards the development of applications (or microservices) that best take advantage of cloud tools and technologies to accomplish resilience, scalability and consistency.

What is a PCF control? ›

Microsoft's Custom PCF Control (PowerApps component framework) was designed to empower both developers and app-builders to create code components for canvas and model-driven apps. By enhancing the overall experience, users are able to work with data in formats such as dashboards, forms, and views with ease.

How do I create a custom app in Dynamics 365? ›

To create Microsoft Dynamics 365 App, Open the app designer from the My Apps page available in the Settings. Navigate toSettings | My Apps | Click New App. Type Tutorialkart in the name field and enter description. Deselect use default Image to use our own custom Icon image as shown below.

How do you create a custom approval workflow in D365 Business Central? ›

Steps:
  1. Manage Approval status for each claim document.
  2. Add "Approval Status" field to Claim Card and buttons to handle approval request entries.
  3. Create events for workflow.
  4. Add events to library.
  5. Check workflow (Activated or No)
  6. Handling workflow response.
  7. Setup claim workflow.
  8. Access record from the approval request page.
17 Mar 2019

Is PCF public or private cloud? ›

PCF is highly automated, easy to install, and runs on any public or private cloud, so organizations can run their applications wherever they choose and scale them across infrastructure targets.

How does a PCF work? ›

PCF is a cloud native platform for deploying next-generation apps. Based on open source technology, PCF enables enterprises to rapidly deliver new experiences to their customers. PCF can be deployed on-premises and on many cloud providers to give enterprises a hybrid and multi-cloud platform.

Which tools are generally used for customization in Dynamics 365? ›

XrmToolBox is a Windows application that connects to Microsoft Dynamics CRM, providing tools to ease customization, configuration and operation tasks.
...
9 Top Tools used by Dynamics 365 CRM Developers.
1Software Development Kit (SDK)
2Plugin Registration Tool
3XRM Totablebox
4Ribbon Workbench
5Sitemap Editor
4 more rows
13 Nov 2017

How do I create a custom workflow in D365? ›

Create Workflow Category
  1. Click on Add > New Item > Business Process and Workflow > Workflow Category.
  2. Enter a proper name.
14 Dec 2021

How do I create a custom action in D365? ›

Activated custom actions are available to processes by selecting the Perform Action item in the Add Step drop down of the web application process form. After the step is added to your process, you can select your new custom action (or any action) from the Action list provided in the step.

How many types of workflows are there in Dynamics 365? ›

Workflow in Dynamics 365 are two types : Asynchronous workflows and Real-time (synchronous) workflows.

What is the Custom workflow in Dynamics CRM 365? ›

What is Custom Workflow Activity? A custom workflow activity allows you to add complex processing steps to your configurable workflows. Custom Workflows can be run on demand as well as after triggering an event. Workflows can be configured by power users using a point and click user interface.

When would you use a custom workflow? ›

Workflows are better when you need the operation needs to be configured periodically by non programmer administrator, where you can implement the configuration part as standard workflow (Workflow1), and static part of the functionality as custom workflow which will be executed by the standard workflow (workflow1).

What is the difference between custom Control and user Control? ›

The main difference between them- User Control is a page file with extension . ascx which can only be used within a single application or project But custom controls are assemblies(dll files) that can be used in multiple applications.

What is one advantage of creating a form with custom controls? ›

This allows your control to contain other controls, and it gives your control a great deal of default functionality. Your custom control will have an associated custom designer. This allows you to create a unique design experience tailored specifically for your custom control.

Which are the two ways to add controls in the form? ›

Answer: In the Toolbox, click the control you want to add to your form. On the form, click where you want the upper-left corner of the control to be located, and drag to where you want the lower-right corner of the control to be located.

Top Articles
Latest Posts
Article information

Author: Arline Emard IV

Last Updated:

Views: 5443

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Arline Emard IV

Birthday: 1996-07-10

Address: 8912 Hintz Shore, West Louie, AZ 69363-0747

Phone: +13454700762376

Job: Administration Technician

Hobby: Paintball, Horseback riding, Cycling, Running, Macrame, Playing musical instruments, Soapmaking

Introduction: My name is Arline Emard IV, I am a cheerful, gorgeous, colorful, joyous, excited, super, inquisitive person who loves writing and wants to share my knowledge and understanding with you.