Exercise – Create a new module

Completed

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:

  1. Work in Visual Studio Code to create a new module.
  2. 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:

  1. Copy the CLI command

    yarn msdyn365 add-module product-feature 
    
  2. Open Visual Studio Code and select Terminal > New Terminal window (ensure that this window is a Command Prompt and not a PowerShell).

  3. In the New terminal window, paste the command that you copied, and then select Enter to run the command.

  4. In the same window, run the Node Server with the command yarn start.

  5. From the sandbox environment (https://localhost:4000/_sdk/allmodules), select the Product feature module, which will display the default defined content.

  6. To update the content, return to the VS Code>Modules>product-feature>product-feature.view.tsx file.

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

  8. Select Save.

  9. Refresh the page. The first two rows should show Hello World before the other text.