Descriptor.xml in Dynamics 365 for Finance and Operations
A package is where the model resides and is located to the right of the model name. The model consists of elements that live within the Application Object Tree/ Application Explorer within Dynamics 365 for Finance and Operations/Dynamics 365 Unified Operations.
While customizing the objects in Visual Studio on a Dynamics 365 Unified Operations project (Dynamics 365 Unified Operations), we have base components that we need to re-use. These base components belong to a model, and this model is stored in a reference package. The metadata of this reference package is stored in a Descriptor file.
Add the Reference package in a Dynamics 365 Unified Operations project:
The requirement was to add fields to the Data Entity EcoResReleasedProductEntity, but the Data Entity has some standard fields that reference the Dimensions component. Now, we have added only the following reference packages while creating the new model.
- Application Foundation
- Application Suite
- Application Platform
We created two extended components, one for the existing Data Entity (EcoResReleasedProductEntity) and one for the corresponding staging table for that data entity (EcoResReleasedProductStaging). We have called it as EcoResReleasedProductEntity. SampleFields and EcoResReleasedProductStaging. SampleFields. After adding the fields to the data entity EcoResReleasedProductEntity. SampleFields and to the appropriate staging table EcoResReleasedProductStaging. SampleFields, we try to build the project. On building the project, there is an error that we receive that states the DimensionSetEntity does not exist.
Fig 1 – Error Dimension related components
This occurs because the Dimensions package is not referenced in the model. To do so, follow the steps highlighted below.
- To add a reference package in the project, select the Dynamics 365 menu -> Update Model Parameters.
Fig 2 – Update Model Parameters
2. On the Update model parameters, select the model to add a reference package. Choose Next and pick the reference package that is Dimensions, in this case.
Fig 3 – Reference the Dimensions package
3. Once the package is referenced, the summary page will display the list of referenced packages.
Fig 4 – Update model parameters
4. Hit Finish and Build the model. This will update the Descriptor file with the referenced package. This is the most crucial step because if there are other developers connected to Visual Studio Team Services and if they are using the same model to do customization in Dynamics 365 for Finance and Operations, then the descriptor file will automatically be updated with the reference package for that developer, too. On building the project, those developers won’t receive any errors because the descriptor file that their metadata repository is referencing to is updated with the reference package.
Fig 5 – Build the Model
Once the model is built, build the project, and the error for DimensionSetEntity will be gone.
5. Check the Descriptor file, and it should have the reference package in there.
Fig 6 – Dimensions Added As A Reference Package