I’m experiencing an issue with multi-select lookups in a SysOperation report in Dynamics AX / Dynamics 365 F&O. I have a report with a UIBuilder and a DataContract where three parameters are defined as
List: parmProjInvoiceId, parmWhsCode, and parmItemId. Only parmProjInvoiceId works correctly; the other two lose their values.
For example, the contract definition for ItemId is:
[DataMemberAttribute('ItemId'),
AifCollectionTypeAttribute('_itemId', Types::String),
SysOperationLabelAttribute("@Labels:InventItemId")]
public List parmItemId(List _itemId = itemId)
{
itemId = _itemId;
return itemId;
}
In the UI, the multi-select lookup works correctly: the _control.text() contains all selected items separated by semicolons, e.g., "item1;item2;item3". However, when the report framework calls the parmItemId() method before processReport(), the _itemId parameter contains only the first item, and the rest are lost.
private void InventItemIdLookUp(FormStringControl _control)
{
QueryBuildDataSource qbdsItemId;
container itemIdContainer;
Query query = new Query();qbdsItemId = query.addDataSource(tableNum(InventItemIdLookupSimpleView));
qbdsItemId.addSelectionField(fieldNum(InventItemIdLookupSimpleView, ItemId));
qbdsItemId.addSelectionField(fieldNum(InventItemIdLookupSimpleView, NameAlias));
qbdsItemId.addSelectionField(fieldNum(InventItemIdLookupSimpleView, ItemType));itemIdContainer = [tableNum(InventItemIdLookupSimpleView), fieldNum(InventItemIdLookupSimpleView, ItemId)];SysLookupMultiSelectGrid::lookup(query, _control, intentItemControl, _control, itemIdContainer);
}
Debugging shows that initially, when parmItemId() is first called, the _itemId list contains all the selected values. At a later point, right before processReport(), the framework calls parmItemId() again and passes only the first value, effectively overwriting the full list with a single item.
I haven’t been able to determine why the SysOperationFramework is dropping the additional values from the list, even though the UI shows them correctly.
I don't know how to resolve this problem, can you help me pls?


Report
All responses (
Answers (