How to do it...

To create the form handler class, follow these steps:

  1. First, we should add all the business logic that relates to data in the table code or table handler class (should the complexity require it). Open the ConVMSVehicleServiceTableType class's code and add the following two methods:
public boolean CanEditStatus(){    // we want to test this on the service status that the record     // currently is, not the status that we might be changing it to    ConVMSVehicleServiceStatus localServiceStatus =      serviceTable.ServiceStatus;    if (serviceTable.orig().RecId != 0)    {        ConVMSVehicleServiceTable origServiceTable =          serviceTable.orig();        localServiceStatus = origServiceTable.ServiceStatus;    }    switch (localServiceStatus)    { case ConVMSVehicleServiceStatus::None: ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.