Exercise - Create a table, add fields, and create field groups
Before you begin
You need to turn off the batch service. Here are the steps to shut off the batch service:
- Open the command prompt in the environment and run as administrator.
- Select Yes in the Do you want to allow this app to make changes to your device? window.
- Type sc queryex DynamicsAxBatch.
- Find the PID number.
- Then enter "taskkill /f /pid PID number .
Scenario
The finance and operations apps developer has been asked to create a new table for the Fleet Management company. The Fleet Management company needs to collect customer information in a different way than the out-of-the-box All Customers page. They want the table to contain both personal and location data by using existing elements in the AOT.
Create a new project
- Minimize the Microsoft Edge window.
- Right-click Visual Studio and select Run as administrator.
- Select Yes in the Do you want to allow this app to make changes to your device? window.
- Select Continue without code.
- Open the File menu and select New > Project.
- In the New Project dialog box, search for Finance Operations , and then select Next.
- In the Configure your new project dialog box, enter FleetManagementProject in the Project name field.
- Select Create.
- To ensure the correct applications suite is referenced, select Dynamics 365 in the Extensions menu.
- Select Model management > Update model parameters.
- Select Fleet Management as the model in the first page.
- Ensure that the Application suite model is referenced.
- Select Next and finish the update.
- Select Dynamics 365 in the Extensions menu again.
- Select Options.
- Under the Dynamics 365 node on the left pane, select Projects.
- Ensure that the checkboxes for Organize projects by element type and Synchronize database on build for newly created project are selected.
- Select OK.
Create a table
- In the Solution Explorer window, right-click the project FleetManagementTableProject.
- Select Add > New Item.
- On the left pane, select Dynamics 365 Items and then select Data Model.
- On the middle pane, select Table.
- Enter FleetCustomersTable in the Name field.
- Select Add.
- The FleetCustomersTable will now be open in the Element Designer window.
- Right-click the FleetCustomersTable heading in the element designer and select Properties.
- In the Properties window, in the Label field, enter Fleet customers.
Add fields to the table
In the Application object tree (AOT) in the Application Explorer window, expand the Data types node.
Expand the Extended Data Types node.
Select and drag the following EDTs onto the Fields node of the table FleetCustomersTable.
- FirstName
- LastName
- Phone
- AddressStreet
- AddressCity
- AddressStateId
- AddressZipCodeId
Select Save in the ribbon.
Right-click the project in the Solution Explorer and click Synchronize FleetManagementTableProject(ISV) [Fleet Management]with Database.
Perform a build by right-clicking the project FleetManagementTableProject in the Solution Explorer window and selecting Build.
Create field groups and add fields to the field groups
- In the Table designer, right-click the Field groups node of the FleetCustomersTable heading.
- Select New group.
- Right-click the new field group and rename it PersonalInfo.
- Expand the Fields node of the FleetCustomersTable.
- Select and drag the FirstName, LastName, Email, and Phone fields from the Fields node to the PersonalInfo Field group.
- In the table designer, right-click the Field groups node of the FleetCustomersTable heading.
- Select New group.
- Right-click the new field group and rename it LocationInfo.
- Expand the Fields node of FleetCustomersTable.
- Select and drag the FirstName, LastName, Email, and Phone fields from the Fields node to the PersonalInfo field group.
- Select and drag the AddressStreet, AddressCity, AddressStateId, and AddressZipCodeId fields from the Fields node to the LocationInfo field group.
- Right-click the project in the Solution Explorer and click Synchronize FleetManagementTableProject(ISV) [Fleet Management] with Database.
- Perform a build by right-clicking the project FleetManagementTableProject in the Solution Explorer window and then selecting Build.

