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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Active Discussion

MultiSelect Enum Parameter Show Number Insted Name

(0) ShareShare
ReportReport
Posted on by 256

5658.Screenshot-_2800_31_2900_.png

//This is UI Builder Method 

public void lookupJobCardType(FormStringControl control)
{
    SysLookupMultiSelectGrid    msJobCardType = SysLookupMultiSelectGrid::construct(control,control);
    Query                       query = new Query();
    QueryBuildDataSource        qbds = query.addDataSource(tableNum(ACX_JobHeader));

    query.dataSourceTable(tableNum(ACX_JobHeader)).addSelectionField(fieldNum(ACX_JobHeader, JobCardtype));

    qbds.addSortField(fieldNum(ACX_JobHeader, JobCardtype));
    qbds.addOrderByField(fieldNum(ACX_JobHeader, JobCardtype));
    qbds.orderMode(OrderMode::GroupBy);

    msJobCardType.parmQuery(query);
    msJobCardType.run();
}

// This is Contract Param Method 

[
        DataMemberAttribute("JobCardType"),
//AifCollectionTypeAttribute('return', Types::Enum,enumStr(Acx_JobCardType)),
//AifCollectionTypeAttribute('_jobCardType', Types::Enum,enumStr(Acx_JobCardType)),
AifCollectionTypeAttribute('_jobCardType',Types::String),


        SysOperationLabelAttribute(literalStr("Job Card Type :")),
        SysOperationDisplayOrderAttribute('3')
]
public List parmJobCardType(List _jobCardType = jobCardType)
{
    jobCardType = _jobCardType;

    return jobCardType;
}

*This post is locked for comments

  • Mea_ Profile Picture
    60,286 on at

    Hi NeoMatrix,

    Usually you use SysLookupMultiSelectGrid::lookup() method where you specify query, control and container with selection fields, so in your case it would be something like:

    public void lookupJobCardType(FormStringControl control)
    {
    container selectedFields = [tablenum(ACX_JobHeader), fieldNum(ACX_JobHeader, JobCardType)]; Query query = new Query(); QueryBuildDataSource qbds = query.addDataSource(tableNum(ACX_JobHeader)); query.dataSourceTable(tableNum(ACX_JobHeader)).addSelectionField(fieldNum(ACX_JobHeader, JobCardtype)); qbds.addSortField(fieldNum(ACX_JobHeader, JobCardtype)); qbds.addGroupByField(fieldNum(ACX_JobHeader, JobCardtype));

    SysLookupMultiSelectGrid::lookup(query, control, control, control, selectedFields); }


    Try this code and see if it helps

  • NeoMatrix Profile Picture
    256 on at
    It Gives The Error Like 
    Argument '_selectField' is incompatible with the required type.
    
    For This Line 
    
    SysLookupMultiSelectGrid::lookup(query, control, control, control, selectedFields);
    
  • Mea_ Profile Picture
    60,286 on at

    There is a typo, try

    SysLookupMultiSelectGrid::lookup(query, control, control, selectedFields);

  • NeoMatrix Profile Picture
    256 on at

     Thanks For the Reply.

    But It gives the error "Type mismatch. Report parameter is of type Enum, but value is of type String."

    In My Project JobCardType is Enum Field.

  • Mea_ Profile Picture
    60,286 on at

    Then you may try SysLookup::lookupEnum() method instead of SysLookupMultiSelectGrid

  • NeoMatrix Profile Picture
    256 on at

    But Requirement is that When I select multiple enum Value in JobCardType  at a time  [one or more].  so Display selected  jobcardtype related data

    7140.Screenshot-_2800_31_2900_.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 24

#2
Michel ROY Profile Picture

Michel ROY 14

#3
Jagadabi Profile Picture

Jagadabi 6

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans