Friday, 17 March 2023

Multi select lookup in D365 FO

 We come across many scenarios where a multiple records need to be selected in a drop down. The usual approach of bringing up the lookup using the "SysLookup" will not work in this case. We have separate classes for bringing up multi select lookup.

Below is one example scenario for multi select lookup.

Let us say we have a field called manufacturing Unit in Sales order (Sales table) where we need to bring up a multiselect lookup. This lookup should bring the "Site" (InventSite Table) in the legal entity.

Below is the sample code for the mentioned scenario.

1. Create an extension class for the for the sales table form

2. make CoC for the form init method

3. Create a parm method to hold the multilookupSelectCtrl object









4. Create an Event Handler class to take the onLookup Event of the form control where the multi select lookup is required.

5. Write the below code to set the selected value to the field.




Below is the result of the code.






No comments:

Post a Comment