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
Copy file name to clipboardExpand all lines: powerapps-docs/developer/component-framework/tutorial-create-model-driven-field-component.md
+43-16Lines changed: 43 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,14 @@ title: "Create a model-driven app field component in Microsoft Dataverse | Micro
3
3
description: "In this tutorial, learn how to create a model-driven app field component, and deploy, configure, and test the component on a form using Visual Studio Code."
4
4
ms.author: noazarur
5
5
author: noazarur-microsoft
6
-
manager: lwelicki
7
-
ms.date: 05/27/2022
6
+
ms.date: 12/21/2022
8
7
ms.reviewer: jdaly
9
8
ms.topic: tutorial
10
9
ms.subservice: pcf
11
10
contributors:
12
11
- JimDaly
13
12
- v-scottdurow
13
+
- kaushikkaul
14
14
---
15
15
16
16
@@ -30,7 +30,7 @@ In addition to these, you'll also ensure the code component follows best practic
30
30
31
31
Before you start, make sure you've installed all the [prerequisite components](implementing-controls-using-typescript.md#prerequisites).
32
32
33
-
## Code
33
+
## Code
34
34
35
35
You can download the complete sample from [here](https://github.com/microsoft/PowerApps-Samples/tree/master/component-framework/ChoicesPickerControl).
36
36
@@ -42,16 +42,16 @@ To create a new `pcfproj`:
42
42
43
43
1. Open Visual Studio Code and navigate to **File** > **Open Folder** and then select the `ChoicesPicker` folder created in the previous step. If you've added the Windows Explorer extensions during the installation of Visual Studio Code, you can also use the **Open with Code** context menu option inside the folder. You can also add any folder into Visual Studio Code using `code .` in the command prompt when the current directory is set to that ___location.
44
44
45
-
1. Inside the new Visual Studio Code PowerShell terminal (**Terminal** > **New Terminal**), use the following command to create a new code component project:
45
+
1. Inside the new Visual Studio Code PowerShell terminal (**Terminal** > **New Terminal**), use the [pac pcf init](/power-platform/developer/cli/reference/pcf#pac-pcf-init) command to create a new code component project:
46
46
47
47
```CLI
48
-
pac pcf init --namespace SampleNamespace --name ChoicesPicker --template field
48
+
pac pcf init --namespace SampleNamespace --name ChoicesPicker --template field --run-npm-install
49
49
```
50
50
51
51
or using the short form:
52
52
53
53
```CLI
54
-
pac pcf init -ns SampleNamespace -n ChoicesPicker -t field
54
+
pac pcf init -ns SampleNamespace -n ChoicesPicker -t field -npm
55
55
```
56
56
57
57
This adds a new `pcfproj` and related files to the current folder, including a `packages.json` that defines the required modules. The above command will also run `npm install` command for you to install the necessary modules.
@@ -95,8 +95,18 @@ The `ChoicesPicker\ControlManifest.Input.xml` file defines the metadata that des
95
95
Open the `ChoicesPicker\ControlManifest.Input.xml` and paste the following inside the control element (replacing the existing **`sampleProperty`**):
96
96
97
97
```xml
98
-
<propertyname="value"display-name-key="Value"description-key="Value of the Choices Control"of-type="OptionSet"usage="bound"required="true"/>
99
-
<propertyname="configuration"display-name-key="Icon Mapping"description-key="Configuration that maps the choice value to a fluent ui icon."of-type="Multiple"usage="input"required="true"/>
98
+
<propertyname="value"
99
+
display-name-key="Value"
100
+
description-key="Value of the Choices Control"
101
+
of-type="OptionSet"
102
+
usage="bound"
103
+
required="true"/>
104
+
<propertyname="configuration"
105
+
display-name-key="Icon Mapping"
106
+
description-key="Configuration that maps the choice value to a fluent ui icon."
107
+
of-type="Multiple"
108
+
usage="input"
109
+
required="true"/>
100
110
```
101
111
102
112
Save the changes and then use the following command to build the component:
@@ -671,14 +681,31 @@ If you want to support multiple languages, your code component can hold a resour
0 commit comments