Skip to content

Commit 7c1e70e

Browse files
authored
Live publish for 28 October 2019.
2 parents 79ac9de + ba3d5fe commit 7c1e70e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+377
-76
lines changed

powerapps-docs/developer/component-framework/create-custom-controls-using-pcf.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,24 @@ ms.assetid: d2cbf58a-9112-45c2-b823-2c07a310714c
1515

1616
# Create and build a code component
1717

18-
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).
1919

2020
## Create a new component
2121

2222
To begin, open **Developer Command Prompt for VS 2017** after installing PowerApps CLI.
2323

24-
1. In the Developer Command Prompt for VS 2017, create a new folder on your local machinefor 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>`.
2525
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:
2727

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>`
2929

3030
> [!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.
3232
3333
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)
3536

3637
## Build your component
3738

powerapps-docs/developer/component-framework/implementing-controls-using-typescript.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ author: Nkrb
1212

1313
# Implement components using TypeScript
1414

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)
23+
5. [Packaging code components](#packaging-your-code-components)
1624

1725
## Creating a new component project
1826

@@ -24,26 +32,28 @@ To create a new project:
2432
mkdir LinearComponent
2533
```
2634
27-
1. Go into the new directory using the command `cd LinearComponent`.
35+
1. Go into the component folder using the command `cd LinearComponent`.
2836
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.
3038
3139
```CLI
3240
pac pcf init --namespace SampleNamespace --name TSLinearInputComponent --template field
3341
```
3442
3543
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.
3745
3846
## Implementing manifest
3947
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:
4151
4252
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:
4353
4454
- **namespace**: Namespace of the code component.
4555
- **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.
4757
- **display-name-key**: Name of the code component that is displayed on the UI.
4858
- **description-name-key**: Description of the code component that is displayed on the UI.
4959
- **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
5464
<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">
5565
```
5666
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:
5868
5969
- **name**: Name of the property.
6070
- **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
6676
```XML
6777
<property name="sliderValue" display-name-key="sliderValue_Display_Key" description-key="sliderValue_Desc_Key" of-type-group="numbers" usage="bound" required="true" />
6878
```
69-
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:
7080
7181
- **code**: Refers to the path where all the resource files are located.
7282
@@ -105,7 +115,7 @@ Manifest is an XML file that contains the metadata of the code component. It als
105115
106116
## Implementing component logic
107117
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.
109119
110120
1. Open the `index.ts` file in the code editor of your choice.
111121
2. Update the `TSLinearInputComponent` class with the following code:
@@ -324,7 +334,7 @@ npm start
324334

325335
## Packaging your code components
326336

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:
328338

329339
1. Create a new folder **Solutions** inside the **LinearComponent** folder and navigate into the folder.
330340
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/
361371
> - Under **Code Tools**, check **NuGet targets & Build Tasks**.
362372

363373
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.
365375

366376
## Adding code components in model-driven apps
367377

powerapps-docs/developer/component-framework/import-custom-controls.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This topic describes how to import code components into Common Data Service. Aft
1717

1818
To create and import a solution file:
1919

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`.
2121

2222
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.
2323

@@ -40,7 +40,7 @@ To create and import a solution file:
4040
> - 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.
4141
4242
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.
4444

4545
## Authenticating to your organization
4646

powerapps-docs/developer/component-framework/overview.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ ms.author: nabuthuk
1616

1717
# PowerApps component framework overview
1818

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:
2020

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.
2222
- Transform a list into an entirely different visual experience bound to the data set like a `Calendar` or `Map`.
2323

2424
> [!IMPORTANT]
@@ -28,11 +28,10 @@ Use PowerApps component framework to create code components for model-driven app
2828
> - Canvas apps only support the *field* type of code components, and not the *dataset* type.
2929
3030

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.
3232

3333
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.
3434

35-
3635
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).
3736

3837
## Related topics

powerapps-docs/developer/component-framework/reference/client.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,27 @@ Disables the scrolling capabilities for the components.
3838
|Method | Description |Available for|
3939
| ------------- |-------------|------|
4040
|[getClient](client/getclient.md)|[!INCLUDE [getclient-description](client/includes/getclient-description.md)]|Model-driven apps and canvas apps (experimental preview)|
41-
|[getFormFactor](client/getformfactor.md)|[!INCLUDE [getformfactor-description](client/includes/getformfactor-description.md)]|Model-driven apps and canvas apps(experimental preview)|
41+
|[getFormFactor](client/getformfactor.md)|[!INCLUDE [getformfactor-description](client/includes/getformfactor-description.md)]|Model-driven apps and canvas apps (experimental preview)|
4242
|[isOffline](client/isoffline.md)|[!INCLUDE [isoffline-description](client/includes/isoffline-description.md)]|Model-driven apps|
4343

44+
## Example
45+
46+
```TypeScript
47+
private createHTMLTableElement(): HTMLTableElement {
48+
let tableElement: HTMLTableElement = document.createElement("table");
49+
tableElement.setAttribute("class", "SampleControlHtmlTable_HtmlTable");
50+
let key: string = "Example Method";
51+
let value: string = "Result";
52+
tableElement.appendChild(this.createHTMLTableRowElement(key, value, true));
53+
key = "getFormFactor()";
54+
value = String(this._context.client.getFormFactor());
55+
tableElement.appendChild(this.createHTMLTableRowElement(key, value, false));
56+
key = "getClient()";
57+
value = String(this._context.client.getClient());
58+
tableElement.appendChild(this.createHTMLTableRowElement(key, value, false));
59+
}
60+
```
61+
4462
### Related topics
4563

4664
[PowerApps component framework API reference](../reference/index.md)<br/>

powerapps-docs/developer/component-framework/reference/control/includes/init-description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ ms.topic: "article"
1212
ms.assetid: 73788966-b83c-4797-8062-8b12bf8409eb
1313
---
1414

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.

powerapps-docs/developer/component-framework/reference/dataset/includes/gettitle-description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ applies_to:
1515
ms.assetid: 00304b7b-63f8-4f37-9294-8d2c08c53704
1616
---
1717

18-
Retrieves the view display name used by the dataset property.
18+
Retrieves the view display name used by the data-set property.

powerapps-docs/developer/component-framework/reference/dataset/includes/getviewid-description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ applies_to:
1515
ms.assetid: df189d10-3fce-48a4-a79b-f1c3b041deb4
1616
---
1717

18-
Returns the Id of view used by dataset parameter.
18+
Returns the Id of view used by data-set parameter.

0 commit comments

Comments
 (0)