Exercise - Extend an EDT

Completed

Scenario

The finance and operations apps developer has been asked by the Fleet Management company to change a number-entry field on the Customer page. The Agency location code field only accepts 12 digits, and the company needs to be able to enter 14 digits. Because the company doesn't need a new field, the developer will create an extension of the AgencyLocationCode EDT in Visual Studio.

Create a new project

  1. Close the Microsoft Edge window and finance and operations.
  2. Right-click the Visual Studio icon on the desktop, and select Run as administrator.
  3. Select Continue without code at the bottom of the page to open Visual studio.
  4. To ensure the correct applications suite is referenced, select Extensions in the toolbar, and then select Dynamics 365 > Model Management > Update model parameters.
  5. Select the FleetManagement model from the Model name drop-down list.
  6. Select Next, then ensure ApplicationSuite is selected in the Select referenced packages drop-down list. Leave any other selections as is.
  7. Select Next three times.
  8. Open the File menu and select New > Project.
  9. Search for Finance Operations if it is not already showing in the latest projects list, and then select Next.
  10. In the Configure your new project dialog box enter FleetManagementExtensionProject in the Project name field.
  11. Select Create.
  12. Select Dynamics 365 > Options in the Extensions menu at the top of the page.
  13. Under the Dynamics 365 node on the left pane, select Projects.
  14. Ensure the check boxes for Organize projects by element type and Synchronize database on build for newly created project are selected. If others are selected, just leave them as is.
  15. Select OK.

Extend the AgencyLocationCode EDT

  1. Select View > Application Explorer in the ribbon to open the Application Explorer.

  2. In the search bar, in the Application Explorer window, expand the AOT node and then expand the Data Types node.

  3. In the Data types node, expand the Extended Data Types node.

  4. Select the AgencyLocationCode EDT.

  5. Right-click the AgencyLocationCode EDT and select Create extension. An element named AgencyLocationCode.FleetManagement will be added to your FleetManagementExtensionProject in Solution Explorer. For demonstration purposes, you will keep the default name.

    Note

    In a real life scenario, we recommend that you rename the extension to avoid conflict with any extensions that are rolled out during application updates. For example, you should rename AgencyLocationCode.Extension to AgencyLocationCode.abcExtension.

  6. Double-click the AgencyLocationCode.FleetManagement element in the Solution Explorer window to open it in the element designer window in the middle of the page.

  7. Right-click the AgencyLocationCode.FleetManagement main node in the element designer window in the middle of the page, and select Properties.

  8. Change the String size property to 14.

  9. Perform a build by right-clicking the project FleetManagementExtensionProject in the Solution Explorer window and then selecting Build. The build should complete without errors.