Multi Select Lookup in AX 2012



Form -> Methods -> Init
For Multiselect Lookup we need to create one Unbound control in the Form.

Before to this we need to create the Master Table to store the values which we need to get in the drop down for lookup in the Multiselect Control


public void init()
{
    QueryRun                        locationQueryRun;
    SysLookupMultiSelectCtrl msCtrlCust;
    Query                           query = new Query();
    QueryBuildDataSource        qbds;
    super();
    qbds = query.addDataSource(tableNum(DMSPartnerBlockingTransactionTypes));
    qbds.fields().dynamic(NoYes::No);
    qbds.fields().addField(fieldNum(DMSPartnerBlockingTransactionTypes,DMSTransactionType));
    msCtrlCust = SysLookupMultiSelectCtrl::constructWithQuery(element,DMSPartnerBlockingTable_DMSTransactionType,query);
    //msCtrlLocation   = SysLookupMultiSelectCtrl::constructWithQueryRun(element, DMSPartnerBlockingTable_DMSTransactionType, locationQueryRun);
    super();
    DMSPartnerBlockingTable_DMSTransactionType.allowEdit(false);
    element.enabling();
}

DMSPartnerBlockingTable_DMSTransactionType -  this is the Unbound Control which we create in the Form for Multiselect 

Comments

Popular posts from this blog

Create RFQ through X++

Base enum values in Dynamics 365

Project Id through X++ code