hljs.configure({cssSelector: "code"}); hljs.highlightAll();

Thursday, August 31, 2023

Legal entity multiselect lookup in D365FO X++

 Legal entity multiselect lookup in D365FO X++ 

public void lookup()
{
   // super();
   Query       query               = new Query();
   TableId     multiSelectTableNum = tableNum(DataArea);
   container   selectedFields = [multiSelectTableNum, fieldName2id(multiSelectTableNum, fieldStr(DataArea, id))];
   query.addDataSource(tableNum(DataArea));
   query.dataSourceTable(tableNum(DataArea)).addSelectionField(fieldNum(DataArea,id));
   query.dataSourceTable(tableNum(DataArea)).addSelectionField(fieldNum(DataArea,Name));
   SysLookupMultiSelectGrid::lookup(query, this,this,this,selectedFields);
}
Query       query               = new Query();
TableId     multiSelectTableNum = tableNum(DataArea);
container   selectedFields = [multiSelectTableNum, fieldName2id(multiSelectTableNum, fieldStr(DataArea, id))];
query.addDataSource(tableNum(DataArea));
query.dataSourceTable(tableNum(DataArea)).addSelectionField(fieldNum(DataArea,id));
query.dataSourceTable(tableNum(DataArea)).addSelectionField(fieldNum(DataArea,Name));

ctrl = SysLookupMultiSelectCtrl::constructWithQuery(this.formRun(),
								this,
								query,
								false,
								selectedFields);

container con = ctrl.GetselectedFieldValues();


Thanks for reading!!

No comments:

Post a Comment