How to do it...

To create the service, follow these steps:

  1. First, create a new class that will hold our service methods and name this class ConWHSVehicleServices.
  2. The first service will be to update the Vehicle service group, for which we have a contract and processing class already created (ConWHSVehicleGroupChangeContract, ConWHSVehicleGroupChange), to write this method; write a method as follows:
public void ChangeVehicleGroup(         ConWHSVehicleGroupChangeContract _contract) {     ConWHSVehicleGroupChange changeGroup =              new ConWHSVehicleGroupChange();     changeGroup.Run(_contract); } 
This will work, but the consumer will not thank us for the lack of error handling. We could either return a Boolean on success or write a return contract. A return ...

Get Extending Microsoft Dynamics 365 for Operations Cookbook 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.