How to do it...

The first part is to create the contract, which is the data that is sent to an endpoint by the business event. This is done as follows:

  1. This event has a nested data contract, so we will create the bill of material lines contract first. Create a class named ConPIBOMLineContract that must be decorated as a DataContract. The completed class should be as follows:
[DataContract]class ConPIBOMLineContract{    ItemId itemId;    Qty qty;    BOMUnitId bomUnitId;    [DataMember('ItemId'), BusinessEventsDataMember('Material Id')]    public ItemId ParmItemId(ItemId _itemId = itemId)    {        itemId = _itemId;        return itemId;    }    [DataMember('Qty'), BusinessEventsDataMember('Quantity')]    public Qty ParmQty(Qty _qty = qty)    {        qty = _qty;        return qty;    } [DataMember('BOMUnitId'), ...

Get Extending Microsoft Dynamics 365 Finance and Supply Chain Management Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.