Skip to content

Commit c6e8eb4

Browse files
authored
Live publish
2 parents a202146 + f29d6ae commit c6e8eb4

File tree

1 file changed

+43
-16
lines changed

1 file changed

+43
-16
lines changed

powerapps-docs/developer/component-framework/tutorial-create-model-driven-field-component.md

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ title: "Create a model-driven app field component in Microsoft Dataverse | Micro
33
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."
44
ms.author: noazarur
55
author: noazarur-microsoft
6-
manager: lwelicki
7-
ms.date: 05/27/2022
6+
ms.date: 12/21/2022
87
ms.reviewer: jdaly
98
ms.topic: tutorial
109
ms.subservice: pcf
1110
contributors:
1211
- JimDaly
1312
- v-scottdurow
13+
- kaushikkaul
1414
---
1515

1616

@@ -30,7 +30,7 @@ In addition to these, you'll also ensure the code component follows best practic
3030
3131
Before you start, make sure you've installed all the [prerequisite components](implementing-controls-using-typescript.md#prerequisites).
3232

33-
## Code
33+
## Code
3434

3535
You can download the complete sample from [here](https://github.com/microsoft/PowerApps-Samples/tree/master/component-framework/ChoicesPickerControl).
3636

@@ -42,16 +42,16 @@ To create a new `pcfproj`:
4242

4343
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.
4444

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

4747
```CLI
48-
pac pcf init --namespace SampleNamespace --name ChoicesPicker --template field
48+
pac pcf init --namespace SampleNamespace --name ChoicesPicker --template field --run-npm-install
4949
```
5050

5151
or using the short form:
5252

5353
```CLI
54-
pac pcf init -ns SampleNamespace -n ChoicesPicker -t field
54+
pac pcf init -ns SampleNamespace -n ChoicesPicker -t field -npm
5555
```
5656

5757
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
9595
Open the `ChoicesPicker\ControlManifest.Input.xml` and paste the following inside the control element (replacing the existing **`sampleProperty`**):
9696

9797
```xml
98-
<property name="value" display-name-key="Value" description-key="Value of the Choices Control" of-type="OptionSet" usage="bound" required="true"/>
99-
<property name="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+
<property name="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+
<property name="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"/>
100110
```
101111

102112
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
671681
```xml
672682
<?xml version="1.0" encoding="utf-8" ?>
673683
<manifest>
674-
<control namespace="SampleNamespace" constructor="ChoicesPicker" version="0.0.1" display-name-key="ChoicesPicker_Name" description-key="ChoicesPicker_Desc" control-type="standard" >
675-
<property name="value" display-name-key="Value_Name" description-key="Value_Desc" of-type="OptionSet" usage="bound" required="true"/>
676-
<property name="configuration" display-name-key="Configuration_Name" description-key="Configuration_Desc" of-type="Multiple" usage="input" required="true"/>
677-
<resources>
678-
<code path="index.ts" order="1"/>
679-
<resx path="strings/ChoicesPicker.1033.resx" version="1.0.0" />
680-
</resources>
681-
</control>
684+
<control namespace="SampleNamespace"
685+
constructor="ChoicesPicker"
686+
version="0.0.1"
687+
display-name-key="ChoicesPicker_Name"
688+
description-key="ChoicesPicker_Desc"
689+
control-type="standard">
690+
<property name="value"
691+
display-name-key="Value_Name"
692+
description-key="Value_Desc"
693+
of-type="OptionSet"
694+
usage="bound"
695+
required="true"/>
696+
<property name="configuration"
697+
display-name-key="Configuration_Name"
698+
description-key="Configuration_Desc"
699+
of-type="Multiple"
700+
usage="input"
701+
required="true"/>
702+
<resources>
703+
<code path="index.ts"
704+
order="1"/>
705+
<resx path="strings/ChoicesPicker.1033.resx"
706+
version="1.0.0" />
707+
</resources>
708+
</control>
682709
</manifest>
683710
```
684711

0 commit comments

Comments
 (0)