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.
List
parmProjInvoiceId
parmWhsCode
parmItemId
For example, the contract definition for ItemId is:
ItemId
[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.
_control.text()
"item1;item2;item3"
parmItemId()
processReport()
_itemId
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?
Thanks,
Waed Ayyad
If this helped, please mark it as "Verified" for others facing the same issue
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 628 Most Valuable Professional
CU05031448-0 578
André Arnaud de Cal... 570 Super User 2025 Season 2