To create the Form Adapter project, follow these steps:
- Select Dynamics 365 for Operations | Create model from the top menu and complete the Create model form as follows:
Field |
Value |
Model name |
ConWHSVehicleManagementFormAdaptor |
Model publisher |
Contoso IT |
Layer |
VAR |
Model description |
Form adapters for the ConWHSVehicleManagement package |
Model display name |
ConWHSVehicleManagementFormAdaptor |
The suffix is important and should always be FormAdaptor.
- Click on Next.
- Select Create new package and click on Next.
- Select ConWHSVehicleManagement and TestEssentials from the Packages [Models] list and click on Next.
- Uncheck the default for creating a project, but leave the default option of making the new model the default for new projects. Click on OK.
- Right-click on the solution node in the Solution Explorer and choose Add | New project....
- In the New Project window, ensure that the Dynamics 365 for Operations template is selected in the left pane, and Operations Project is selected in the right. Enter ConWHSVehicleManagementFormAdaptor as Name and click on OK.
- Save all and close Visual Studio.
- If the package was called ConWHSVehicleManagementFormAdapter, navigate to the following folder in Windows Explorer:
C:AOSServicePackagesLocalDirectoryConWHSVehicleManagementFormAdapterDescriptor
- Open the ConWHSVehicleManagementFormAdapter.xml file in Notepad and add the highlighted line in order to tell the model which model is the source to build form adapters:
<AppliedUpdatesxmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<Customization>Allow</Customization>
<Description>Form adapters for the ConWHSVehicleManament package</Description>
<DisplayName>ConWHSVehicleManagementFormAdapter</DisplayName>
<FormAdaptorSourceModel>ConWHSVehicleManagement</FormAdaptorSourceModel>
<Id>895571399</Id>
Do not edit any other part of this file. The option to set the form adaptor source model directly in Visual Studio may be added to later versions, so this step might not be required in the future.
- Open Visual Studio and the ConWHSVehicleManagement solution, then right-click on the ConWHSVehicleManagementFormAdaptor project, and choose Properties.
- Change the Generate Form Adapters property to True.
- Right-click on the ConWHSVehicleManagementForm project and choose Properties and change the Generate Form Adapters property to True.
- Select Build models... from the Dynamics 365 menu and build both models.
- This should generate and add a class for each form, suffixed with FormAdaptor. If they don't appear, you can locate them in the Application Explorer and add them manually.