Sunday, July 2, 2023

Create a PCF Control

Create a folder for the project. Then open the command prompt, navigate to that folder and run the following command.

pac pcf init --namespace YourNamespace --name YourComponent --template field

Install node.js from the nodejs website, then run following command in the same project directory through command prompt
 
npm install
 
Open project in Visual Studio Code by running the following command.
 
code .
 
If the above command does not work, open Folder in visual studio manually. 


Build the Package using the following command
 
npm run build

Start the package
 
npm start

Or start the package with live changes
 
npm start watch

Package PCF Component (Need visual studio build tools or visual studio full installation)
Open Developer Command Prompt for VS 2022 and run the following command
 
msbuild /t:build /restore (the restore flag is only needed the first time we are building our package)

Deploy the PCF Control
 
pac auth create --url https://[yoururl].crm[yourversion].dynamics.com

(Optional) To list authentication profiles
 
pac auth list

(Optional) To select authentication profiles
 
pac auth select --index 1

(Optional) To get profile organization details
 
pac org who
 
Push package to Dataverse
 
pac pcf push --publisher-prefix mspp
 
 
 


No comments:

Post a Comment