Hi All,
In AX 2012 we create multi-select lookup for a control using SysLookupMultiSelectCtrl class for example tutorial_LookupMultiSelectGrid form. I have tried the same in D365 for the string edit control using OnLookup event but the selected values not shown in the string-edit. Here is my code...
[FormControlEventHandler(formControlStr(SysDocuBrandDetails, SysDocuBrandDetails_CompanySelection), FormControlEventType::Lookup)]
public void SysDocuBrandDetails_CompanySelection_OnLookup(FormControl sender, FormControlEventArgs e)
{
SysLookupMultiSelectCtrl msCtrlCust;
container controllookup;
FormStringControl stringControl = sender.formRun().design().controlName('SysDocuBrandDetails_CompanySelection') as FormStringControl;
FormRun formRun = sender.formRun();
Query query = new Query();
QueryBuildDataSource qbds;
qbds = query.addDataSource(tableNum(CompanyInfo));
// qbds.fields().dynamic(NoYes::Yes);
qbds.fields().addField(fieldNum(CompanyInfo,DataArea));
qbds.fields().addField(fieldNum(CompanyInfo,Name));
//assigning control and query to the class
msCtrlCust = SysLookupMultiSelectCtrl::constructWithQuery(formRun, stringControl, query, false, controllookup );
}
Please tell me why it is not working in D365 whereas it is working fine in AX 2012.
*This post is locked for comments
I have the same question (0)