Exercise – Create a new module
As an e-Commerce developer for the Fabrikam company, you have been asked to create a new module. The company wants a simple module that will be named Product-feature.
In this exercise, you will perform the following tasks:
- Work in Visual Studio Code to create a new module.
- Update the content in the module.
Before you begin
You will need to have an environment with the development tools and SDK installed and Visual Studio Code.
Create a new module
To create a new module, follow these steps:
Copy the CLI command
yarn msdyn365 add-module product-feature
Open Visual Studio Code and select Terminal > New Terminal window (ensure that this window is a Command Prompt and not a PowerShell).
In the New terminal window, paste the command that you copied, and then select Enter to run the command.
In the same window, run the Node Server with the command
yarn start
.From the sandbox environment (
https://localhost:4000/_sdk/allmodules
), select the Product feature module, which will display the default defined content.To update the content, return to the VS Code>Modules>product-feature>product-feature.view.tsx file.
Open the file and update the content in the <h2> tags from the HTML format. Enter Hello before Config Value and then enter World before Resource Value.
Select Save.
Refresh the page. The first two rows should show Hello World before the other text.