To create a new lookup handler event, follow these steps:
- Since this handles the lookup event on the SalesTable form, create a class named SalesTable_ConVehicleManagement_FormHandler.
- Open the SalesTable form design, and expand Data Sources, SalesLine, and then ItemId.
You will see there is no lookup event here, which means we can't override the lookup so that all controls based on this field will be affected. We can't use the Chain of Command on the lookup method because it does not support nested objects, and this forces us to override the lookup at the control level.
- Next, find the SalesLineGrid grid control, and expand the SalesLine_ItemId control to see the events that it has.
- Right-click on OnLookup and choose Copy ...
Get Extending Microsoft Dynamics 365 Finance and Supply Chain Management Cookbook - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.