web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Multi-Select Lookup Values Lost in DataContract List in SysOperation Report

(3) ShareShare
ReportReport
Posted on by 6

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.

 

Here is an example of how the multi-select lookups are configured in the UIBuilder:
 
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? 

Categories:
I have the same question (0)
  • Waed Ayyad Profile Picture
    8,997 Super User 2025 Season 2 on at
    Multi-Select Lookup Values Lost in DataContract List in SysOperation Report
    Hi,
     
    Can you show us your code of UI and Contract classes? based on your debugging, what is the method that overriding the parmItemId()?
    Do you have any code in the controller class that override the contract parameters?
     
     

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 596 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 570 Super User 2025 Season 2

#3
CU05031448-0 Profile Picture

CU05031448-0 556

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans