MB-500: Microsoft Dynamics 365: Finance and Operations Apps Developer
Lab 4: Create an aggregated data entity
Change Record
Version | Date | Change |
---|---|---|
1.0 | 23 Aug 2024 | Initial release |
Objective
This lab consists of several exercises. Requirements include a working development virtual machine (VM) with access to the finance and operations apps and Microsoft Visual Studio. In the:
-
First exercise, you’ll create an aggregated data entity for inventory onhand.
-
Second exercise, you’ll test the outcome of the aggregated data entity.
Exercise 1: Create an aggregated data entity
To create an aggregated data entity:
-
Open Visual Studio 2019 on your VM and select Continue without code.
-
Create the solution you want to work with:
- Select Extensions > Dynamics 365 > Model Management > Create
Model.
If ‘Feedback on Finance and Operations(Dynamics 365)’ screen pops up, select ‘Not Now’.
-
In Create model:
-
For Add parameters, enter the following values, and then select Next:
-
Model name: MB-500Lab4
-
Model publisher: Microsoft
-
-
For Select package, select Create new package.
-
For Select referenced packages, ensure the following are selected:
-
ApplicationFoundation
-
ApplicationPlatform
-
ApplicationSuite
-
-
Select Next and Next
-
-
On Configure your new project, enter these values, and then select Create:
-
Project name: AggregatedDataEntity
-
SolutionName: AggregatedDataEntity
-
- Select Extensions > Dynamics 365 > Model Management > Create
Model.
-
In Solution Explorer, right-click your project to open the context menu, and then select Properties.
-
Verify the Synchronize Database property is set to True, and then select OK.
-
Right-click your project to open the context menu, and then select Add > New Item.
-
Navigate to FinanceOperations > Dynamics 365 Items > Analytics > Aggregate Measurement.
-
Enter InventOnhandAggregateMeasurement as the name, and then select Add.
-
Select View > Application Explorer to view the AOT.
-
Enter InventOnHandByWarehouseStatus in the Search field, and then select Enter.
-
Select InventOnHandByWarehouseStatus from Views, and then drag it to MeasureGroup1.
-
Expand the Dimensions node and remove the Date_ field.
-
Go to the Measures node, and then right-click it to open the context menu and select New Measure.
-
In Properties for Measure1, select the following values:
-
Field: AvailOrdered
-
Default Aggregate: Sum
-
Name: AvailOrdered
-
-
Go to the Measures node, and then right-click it to open the context menu and select New Measure.
-
In the Properties for Measure1, select the following values:
-
Field: AvailPhysical
-
Default Aggregate: Sum
-
Name: AvailPhysical
-
-
Go to the Attributes node, and then right-click it to open the context menu and select New Dimension Attibute.
-
In the Properties for DimensionAttribute1, select the following values
-
Name: ItemId
-
Usage: Key
-
-
Go to the blank node under ItemId and in the Properties, select ItemId for the Dimension Field.
-
Select Save all, and then right-click your project to open the context menu and select Add > New Item.
-
Navigate to FinanceOperations > Dynamics 365 Items > Analytics > Aggregate Dimension.
-
Enter InventOnhandAggregateDimension as the name, and then select Add.
-
Enter InventOnHandByWarehouseStatus in the Search field in the Application Explorer, and then select Enter.
-
Select the View InventOnHandByWarehouseStatus, and then drag it to the root node of InventOnhandAggregateDimension.
-
Remove @InventOnhandAggregateDimension from the @Attributes node
-
In the ItemId Attribute, select Key for Usage.
-
Select Save all, and then select InventOnhandAggregateMeasurement in the Designer view.
-
In Solution Explorerer, find the Aggregate Dimension InventOnhandAggregateDimension and drag it into the Dimensions node on InventOnhandAggregateMeasurement.
-
Right-click the InventOnhandAggregateDimension node under Dimensions to open the context menu, and then select New Relation.
-
In the Properties for DimensionRelation1, select the following values:
-
Dimension Attribute: ItemId
-
Name: ItemIdRelation
-
-
In the Properties for ItemIdRelation > InventOnHandWarehouseStatus.ItemId == InventOnHandByWarehouseStatus, select ItemId for the Related field.
-
Select Save all
-
Select the top node for InventOnhandAggregateMeasurement under Aggregate Measurements.
-
In the Properties, select InMemoryRealTime for Usage.
-
In the Solution Explorer, right-click InventOnhandAggregateMeasurement under Aggregate Measurements to open the context menu, and then select Add Column Store Indices.
-
Select Save all.
Add a data entity
-
Right-click your project to open the context menu, and then select Add > New Item.
-
Navigate to FinanceOperations > Dynamics 365 Items > Analytics > Aggregate Data Entity.
-
Enter InventOnhandAggregateDataEntity as the name, and then select Add.
-
In Solution Explorer, find InventOnhandAggregateMeasurement and drag it into the DataSource node on InventOnhandAggregateDataEntity.
-
Go to the DataSource node, and then select InventOnhandAggregateMeasurement > InventOnHandByWarehouseStatus > Measures and drag AvailOrdered and AvailPhysical into the Fields node on InventOnhandAggregateDataEntity.
-
Go to the DataSource node > InventOnhandAggregateMeasurement >InventOnHandByWarehouseStatus > Dimensions and drag InventOnhandAggregateDimension into the Fields node.
-
In the Properties for the InventOnhandAggregateDimension field, select ItemId for Attribute.
-
Navigate to the top node on InventOnhandAggregateDataEntity.
-
In the Properties, select the following values:
-
Is Public: Yes
-
Public Collection Name: MyAggregateDataEntities
-
Public Entity Name: InventOnhandAggregateEntity
-
Primary Key: ItemKey
-
-
Select the Keys node at the InventOnhandAggregateDataEntity aggregate data entity, and then right-click it to open the context menu and select New Key.
-
In the Properties for AggregateDataEntityKey1, select ItemKey for Name.
-
Right-click the ItemKey key to open the context menu, and then select New Field.
-
In the Properties for the new field, select ItemId for Data Field.
-
Select Save All, and then right-click your project to open the context menu and select Build.
Exercise 2: Test an aggregated data entity
To test an aggregate data entity:
-
In Microsoft Edge, set your default company to USMF: Bring up the home screen, select the gear (Settings) > User options > Preferences, and change the Startup Company to USMF.
-
enter the following URL in the address field, and then select Enter: https://usnconeboxax1aos.cloud.onebox.dynamics.com/data/MyAggregateDataEntities.
-
A list of items with AvailOrdered and AvailPhysical will display, grouped by ItemId