This article will explore one method of exposing data entities (OData) to the public for communication with external software applications. This is a common requirement for clients that require EDI because not all data entities within Dynamics 365 are public. Currently, the ability to extend data entities and change its parameters is not possible, so one workaround is to duplicate or “copy” the data entity into a project and changing the IsPublic parameter to Yes.
In this example, we will go through exposing the DlvDeliveryModeEntity data entity.
Copy the Data Entity
- Open the Application Explorer.
- Navigate to AOT > Data Model > Data Entities and select DlvDeliveryModeEntity.
- In the Solution explorer, right-click the entity and select Properties.
- In the Name field, enter myDlvDeliveryModeEntity.
- Set the IsPublic parameter to Yes.
- Enter myDlvDeliveryModeEntity in the Public Collection Name and Public Entity Name
- Replace the original data entity name in methods.
Give Permission to Read the Data Entity
- Open the Application Explorer.
- Navigate to AOT > Data Model > Data Entities.
- Right-click DlvDeliveryModeEntity and select Find references.
- In the output window, look for the privileges associated with the DlvDeliveryModeEntity data entity.
- Open the Application Explorer.
- Navigate to AOT > Security > Security Privileges.
- Right–click DlvDeliveryModeEntityExport and select Duplicate in project.
- Rename the privilege to myDlvDeliveryModeEntityExport.
- In the Solution Explorer, right-click and open myDlvDeliveryModeEntityExport in the Designer.
- Delete the existing entity under the Data entity permissions and add the data entity
- Open the Application Explorer.
- Navigate to AOT > Data Model > Security Privileges.
- Right-click DlvDeliveryModeEntityExport and select Find references.
- In the output window, look for the Duty associated with the privilege DlvDeliveryModeEntityExport.
- Open the Application Explorer.
- Navigate to AOT > Security > Security Duties.
- Right-click DataManagementApplicationExtReferenceEntitiesView and duplicate in project.
- Rename the Duty to myDataManagementApplicationExtReferenceEntitiesView.
- Open myDataManagementApplicationExtReferenceEntitiesView in designer and add myDelvDeliveryModeEntityExport to the priviledges
Want to learn more? Visit academy.rsmsus.com for eLearning courses and information about our hosted training classes in Denver! Or Contact our Microsoft Dynamics experts at RSM (855) 437-7201
By: Mathias Quandt and Pierre Abdel-Malek