General X++ Development

How do I create a multi-select lookup in D365FO?

Asked by Sunny Vasty· Aug 13, 2026· 1 answers

How do I create a multi-select lookup in D365FO?

SSunny Vasty75 reputation · answered Aug 13, 2026

A common X++ option is SysLookupMultiSelectCtrl.

X++
SysLookupMultiSelectCtrl multiSelectCtrl;

multiSelectCtrl =
    SysLookupMultiSelectCtrl::constructWithQuery(
        element,
        YourStringControl,
        query);

Keep the controller as a form/class member if you need the selected values later. If you create it as a local variable and then throw the reference away, you make the rest of the form harder than it needs to be.