How to do it...

We will first construct an attribute class that will be used to tell the framework which class should be made for the status value; this is done with the following steps:

  1. Create a new class named ConVMSVehicleServiceStatusAttribute.
  2. The contents of this class is nearly the same for all attribute classes, and we can use a string or base enum. In this case, we are using the ConVMSVehicleServiceStatus enum, so write the following code:
class ConVMSVehicleServiceStatusAttribute    extends SysAttribute     implements SysExtensionIAttribute{    ConVMSVehicleServiceStatus serviceStatus;    public void new(ConVMSVehicleServiceStatus _serviceStatus)    {         serviceStatus = _serviceStatus;    }    public str parmCacheKey()    { // This key must be invariant ...

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.