You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This topic explains how to create and deploy code components using PowerApps CLI. Ensure that you have installed [Microsoft PowerApps CLI](https://aka.ms/PowerAppsCLI).
18
+
This topic demonstrates how to create and deploy code components using PowerApps CLI. Ensure that you have installed [Microsoft PowerApps CLI](https://aka.ms/PowerAppsCLI).
19
19
20
20
## Create a new component
21
21
22
22
To begin, open **Developer Command Prompt for VS 2017** after installing PowerApps CLI.
23
23
24
-
1. In the Developer Command Prompt for VS 2017, create a new folder on your local machine—for example, *C:\Users\your name\Documents\My_PCF_Component* using the command `mkdir <Specify the folder name>`.
24
+
1. In the Developer Command Prompt for VS 2017, create a new folder on your local machine, for example, *C:\Users\your name\Documents\My_code_Component* using the command `mkdir <Specify the folder name>`.
25
25
2. Go to the newly created folder using the command `cd <specify your new folder path>`.
26
-
3.Run the following command to create a new component project by passing some basic parameters:
26
+
3.Create a new component project by passing some basic parameters using the command:
27
27
28
-
`pac pcf init --namespace <specify your namespace here> --name <put component name here> --template <component type>`
28
+
`pac pcf init --namespace <specify your namespace here> --name <Name of the code component> --template <component type>`
29
29
30
30
> [!NOTE]
31
-
> Currently, PowerApps CLI supports two types of components: **field** and **dataset**. For canvas apps, only the **field** type is supported for this experimental preview.
31
+
> Currently, PowerApps CLI supports two types of components: **field** and **dataset** for model-driven apps. For canvas apps, only the **field** type is supported for this experimental preview.
32
32
33
33
4. To retrieve all the required project dependencies, run the command `npm install`.
34
-
5. Open your project folder `C:\Users\<your name>\Documents\<My_PCF_Component>` in any developer environment of your choice and get started with your code component development. The quickest way to get started is by running `code .` from your command prompt once you are in the `C:\Users\<your name>\Documents\<My_PCF_Component>` directory. This command opens your component project in Visual Studio Code.
34
+
5. Open your project folder `C:\Users\<your name>\Documents\<My_code_Component>` in any developer environment of your choice and get started with your code component development. The quickest way to get started is by running `code .` from your command prompt once you are in the `C:\Users\<your name>\Documents\<My_code_Component>` directory. This command opens your component project in Visual Studio Code.
35
+
6. Implement the required artifacts for the component like manifest, component logic and styling and then build the component project. More information: [Implementing sample component](implementing-controls-using-typescript.md)
Copy file name to clipboardExpand all lines: powerapps-docs/developer/component-framework/implementing-controls-using-typescript.md
+21-11Lines changed: 21 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,15 @@ author: Nkrb
12
12
13
13
# Implement components using TypeScript
14
14
15
-
This tutorial walks you through the process of creating a new code component in TypeScript. The sample component is a linear input component that enables users to enter numeric values using a visual slider instead of typing the values in the field.
15
+
This topic walks you through the process of creating a new code component in TypeScript using the PowerApps CLI. In this tutorial we will build a sample linear code component that enables users to change the numeric values using a visual slider instead of typing the values in the field.
16
+
17
+
The artifacts that are required to build code components are:
18
+
19
+
1.[Create a new component project](#creating-a-new-component-project)
20
+
2.[Implementing manifest](#implementing-manifest)
21
+
3.[Implement component logic using TypeScript](#implementing-component-logic)
22
+
4.[Add style to the code components](#adding-style-to-the-code-component)
1. Go into the new directory using the command `cd LinearComponent`.
35
+
1. Go into the component folder using the command `cd LinearComponent`.
28
36
29
-
1. Run the following command to create a new component project passing basic parameters.
37
+
1. Create a new component project by passing basic parameters using the command.
30
38
31
39
```CLI
32
40
pac pcf init --namespace SampleNamespace --name TSLinearInputComponent --template field
33
41
```
34
42
35
43
1. Install the project build tools using the command `npm install`.
36
-
2. Open your project folder `C:\Users\<your name>\Documents\<My_PCF_Component>` in a developer environment of your choice and get started with your code component development. The quickest way to start is by running `code .` from the command prompt once you are in the `C:\Users\<your name>\Documents\<My_PCF_Component>` directory. This command opens your component project in Visual Studio Code.
44
+
1. Open your project folder `C:\Users\<your name>\Documents\<My_code_Component>` in a developer environment of your choice and get started with your code component development. The quickest way to start is by running `code .` from the command prompt once you are in the `C:\Users\<your name>\Documents\<My_code_Component>` directory. This command opens your component project in Visual Studio Code.
37
45
38
46
## Implementing manifest
39
47
40
-
Manifest is an XML file that contains the metadata of the code component. It also defines the behavior of the code component. In this tutorial, this manifest file is created under the `<Your component Name>` subfolder. When you open the `ControlManifest.Input.xml` file in Visual Studio Code, you'll notice that the manifest file is predefined with some properties. Make changes to the predefined manifest file, as shown here:
48
+
Manifest is an XML file that contains the metadata of the code component. It also defines the behavior of the code component. In this tutorial, this manifest file is created under the `<Your component Name>` subfolder. When you open the `ControlManifest.Input.xml` file in Visual Studio Code, you'll notice that the manifest file is predefined with some properties. More information: [Manifest](manifest-schema-reference/manifest.md).
49
+
50
+
Make changes to the predefined manifest file, as shown here:
41
51
42
52
1. The [control](manifest-schema-reference/control.md) node defines the namespace, version, and display name of the code component. Now, define each property of the [control](manifest-schema-reference/control.md) node as shown here:
43
53
44
54
- **namespace**: Namespace of the code component.
45
55
- **Constructor**: Constructor of the code component.
46
-
- **Version**: Version of the component. Whenever you update the component, you need to update the version to see the changes in the runtime.
56
+
- **Version**: Version of the component. Whenever you update the component, you need to update the version to see the latest changes in the runtime.
47
57
- **display-name-key**: Name of the code component that is displayed on the UI.
48
58
- **description-name-key**: Description of the code component that is displayed on the UI.
49
59
- **control-type**: The code component type. Only *standard* type of code components are supported.
@@ -54,7 +64,7 @@ Manifest is an XML file that contains the metadata of the code component. It als
54
64
<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">
55
65
```
56
66
57
-
2. The [property](manifest-schema-reference/property.md) node defines the properties of the code component like defining the data type of field. The property node is specified as the child element under the control element. Define the [property](manifest-schema-reference/property.md) node as shown here:
67
+
2. The [property](manifest-schema-reference/property.md) node defines the properties of the code component like defining the data type of field. The property node is specified as the child element under the `control` element. Define the [property](manifest-schema-reference/property.md) node as shown here:
58
68
59
69
- **name**: Name of the property.
60
70
- **display-name-key**: Display name of the property that is displayed on the UI.
@@ -66,7 +76,7 @@ Manifest is an XML file that contains the metadata of the code component. It als
3. The [resources](manifest-schema-reference/resources.md) node defines the visualization of the code component. It contains all the resources that make up the code component. The [code](manifest-schema-reference/code.md) is specified as a child element under the resources element. Define the [resources](manifest-schema-reference/resources.md) as shown here:
79
+
3. The [resources](manifest-schema-reference/resources.md) node defines the visualization of the code component. It contains all the resources that build the visualization and styling of the code component. The [code](manifest-schema-reference/code.md) is specified as a child element under the resources element. Define the [resources](manifest-schema-reference/resources.md) as shown here:
70
80
71
81
- **code**: Refers to the path where all the resource files are located.
72
82
@@ -105,7 +115,7 @@ Manifest is an XML file that contains the metadata of the code component. It als
105
115
106
116
## Implementing component logic
107
117
108
-
The next step after implementing the manifest file is to implement the component logic using TypeScript. The component logic should be implemented inside the `index.ts` file. When you open the `index.ts` file in the Visual Studio Code, you notice that the four essential classes are predefined. Now, let's implement the logic for the code component.
118
+
The next step after implementing the manifest file is to implement the component logic using TypeScript. The component logic should be implemented inside the `index.ts` file. When you open the `index.ts` file in the Visual Studio Code, you'll notice that the four essential classes are predefined. Now, let's implement the logic for the code component.
109
119
110
120
1. Open the `index.ts` file in the code editor of your choice.
111
121
2. Update the `TSLinearInputComponent` class with the following code:
@@ -324,7 +334,7 @@ npm start
324
334
325
335
## Packaging your code components
326
336
327
-
Follow these steps to create and import a [solution](https://docs.microsoft.com/dynamics365/customer-engagement/customize/solutions-overview) file:
337
+
Follow these steps to create and import a [solution](https://docs.microsoft.com/powerapps/maker/common-data-service/solutions-overview) file:
328
338
329
339
1. Create a new folder **Solutions** inside the **LinearComponent** folder and navigate into the folder.
330
340
2. Create a new solution project in the **LinearComponent** folder using the following command:
@@ -361,7 +371,7 @@ Follow these steps to create and import a [solution](https://docs.microsoft.com/
6. The generated solution zip file is located in the `Solution\bin\debug` folder.
364
-
7. Manually [import the solution into Common Data Service](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/customize/import-update-upgrade-solution) using the web portal once the zip file is ready or see the [Authenticating to your organization](import-custom-controls.md#authenticating-to-your-organization) and [Deployment](import-custom-controls.md#deploying-code-components) sections to import using PowerApps CLI commands.
374
+
7. Manually [import the solution into Common Data Service](https://docs.microsoft.com/powerapps/maker/common-data-service/import-update-export-solutions) using the web portal once the zip file is ready or see the [Authenticating to your organization](import-custom-controls.md#authenticating-to-your-organization) and [Deployment](import-custom-controls.md#deploying-code-components) sections to import using PowerApps CLI commands.
Copy file name to clipboardExpand all lines: powerapps-docs/developer/component-framework/import-custom-controls.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ This topic describes how to import code components into Common Data Service. Aft
17
17
18
18
To create and import a solution file:
19
19
20
-
1. Create a new folder and name it **Solution** (or any name of your choice) using the command `mkdir Solutions`. Navigate into the directory using the command `cd Solutions`.
20
+
1. Create a new folder inside the sample component folder and name it **Solution** (or any name of your choice) using the command `mkdir Solutions`. Navigate into the directory using the command `cd Solutions`.
21
21
22
22
2. Create a new solutions project using the command `pac solution init --publisher-name <enter your publisher name> --publisher-prefix <enter your publisher prefix>`. The solution project is used for bundling the code component into a solution zip file that is used for importing into Common Data Service.
23
23
@@ -40,7 +40,7 @@ To create and import a solution file:
40
40
> - If you encounter an error that says *Ambiguous project name* when running the `msbuild` command on your solution, ensure that your solution name and project name are not the same.
41
41
42
42
4. The generated solution files are located inside the `\bin\debug\` folder after the build is successful.
43
-
5. Manually [import the solution into Common Data Service](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/customize/import-update-upgrade-solution) using the web portal or see the [Authenticating to your organization](#authenticating-to-your-organization) and [Deployment](#deploying-code-components) sections to import using PowerApps CLI commands.
43
+
5. Manually [import the solution into Common Data Service](https://docs.microsoft.com/powerapps/maker/common-data-service/import-update-export-solutions) using the web portal or see the [Authenticating to your organization](#authenticating-to-your-organization) and [Deployment](#deploying-code-components) sections to import using PowerApps CLI commands.
Copy file name to clipboardExpand all lines: powerapps-docs/developer/component-framework/overview.md
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,9 @@ ms.author: nabuthuk
16
16
17
17
# PowerApps component framework overview
18
18
19
-
Use PowerApps component framework to create code components for model-driven apps and canvas apps (experimental preview) to provide an enhanced user experience for the users to view and work with data in forms, views, and dashboards. For example:
19
+
PowerApps component framework empowers professional developers and app makers to create code components for model-driven apps and canvas apps (experimental preview) to provide an enhanced user experience for the users to view and work with data in forms, views, and dashboards. For example:
20
20
21
-
- Replace a field that displays a numeric text value with a `dial` or `slider` component.
21
+
- Replace a field that displays a numeric text value with a `dial` or `slider`code component.
22
22
- Transform a list into an entirely different visual experience bound to the data set like a `Calendar` or `Map`.
23
23
24
24
> [!IMPORTANT]
@@ -28,11 +28,10 @@ Use PowerApps component framework to create code components for model-driven app
28
28
> - Canvas apps only support the *field* type of code components, and not the *dataset* type.
29
29
30
30
31
-
PowerApps component framework enables professional developers and app makers to create code components that can be used across the full breadth of PowerApps capabilities. Unlike HTML web resources, code components are rendered as a part of the same context, load at the same time as any other components, providing a seamless experience for the users. Developers can bundle all the HTML, CSS, and TypeScript or JavaScript files into a single solution package file. Code components can be reused many times across different entities and forms.
31
+
Use PowerApps component framework to create code components that can be used across the full breadth of PowerApps capabilities. Unlike HTML web resources, code components are rendered as a part of the same context, load at the same time as any other components, providing a seamless experience for the users. Developers can bundle all the HTML, CSS, and TypeScript or JavaScript files into a single solution package file. Code components can be reused many times across different entities and forms.
32
32
33
33
Code components have access to a rich set of framework APIs that expose capabilities like component lifecycle management, contextual data and metadata access, 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.
34
34
35
-
36
35
Developers and app makers can use modern web practices and also harness the power of external libraries to create advanced user interactions. The framework automatically handles the component lifecycle, retains application business logic, and optimizes for performance (no more async IFrames). Component definition, dependencies, and configurations can all be packaged into a [solution](https://docs.microsoft.com/dynamics365/customer-engagement/customize/solutions-overview) and moved across environments and can be shipped via [AppSource](https://appsource.microsoft.com/en-us/marketplace/apps?page=1&product=dynamics-365).
Copy file name to clipboardExpand all lines: powerapps-docs/developer/component-framework/reference/control/includes/init-description.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,4 +12,4 @@ ms.topic: "article"
12
12
ms.assetid: 73788966-b83c-4797-8062-8b12bf8409eb
13
13
---
14
14
15
-
Used to initialize the component instance. Components can kick off remote server calls and other initialization actions. Dataset values cannot be initialized here, use the [updateView](../updateview.md) method to achieve that.
15
+
Used to initialize the component instance. Components can kick off remote server calls and other initialization actions. Data-set values cannot be initialized here, use the [updateView](../updateview.md) method to achieve that.
0 commit comments