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 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.