Common commands used
These are some common commands list which are used while developing a code component or PCF control.
Creating a new component project
Use this command to create new code component project.
For Standard Control
pac pcf init --namespace <specify your namespace here> --name <name of the code component> --template <component type> --run-npm-install
For React Based Control
pac pcf init --namespace <specify your namespace here> --name <name of the code component> --template <component type> --framework react --run-npm-install
Build your component
Use this command to build your code component project.
npm run build
npm run build --buildMode production
Debugging using the browser test harness
Use npm start or npm start watch to build the code component and open the local test harness in a new browser window. Watch mode enables you to quickly see the changes in action.
npm start
npm start watch
Ctrl + C to stop the debugging
Package a code component
Use this command to generate D365 CRM solution zip file, which can be imported into Dataverse.
pac solution init --publisher-name <name of the publisher> --publisher-prefix <prefix to be used>
pac solution add-reference --path <path of the pcf control root folder>
msbuild /t:build /restore
msbuild
msbuild /p:configuration=Release
Connecting to your environment
Use these commands to connect to Dataverse and deploy code component to Dataverse directly from Visual Studio Code.
pac auth create --url https://xyz.crm.dynamics.com
pac auth list
pac auth select --index <index of the active profile>
pac pcf push --publisher-prefix <your publisher prefix>
Comments