How to do it...

To add a custom lookup to a control on a standard form, please follow these steps

  1. Create a new class that could be a generic sales order utility class, or ideally a form extension class (see previous recipe for this).
The naming is key so that we can easily find it. There is no obvious link that we have done this, so naming and documentation is critical.
  1. The first example is to make the sales order create dialog using a lookup form. As standard (in the November release), the lookup only contains the account number and account. This example binds the custom lookup to the customer account's lookup event, as follows:
/// <summary> /// Override the customer lookup on the sales order create  /// dialog in order to use a lookup ...

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.