Multiselect Enum Parameter Field show number instead of Name

Screenshot (31).png

public void lookupJobCardType(FormStringControl control) { SysLookupMultiSelectGrid MSjobCardType; Query query; QueryBuildDataSource qbds; counter counter; MSjobCardType = SysLookupMultiSelectGrid::construct(control,control); query = new Query(); qbds = query.addDataSource(tableNum(ACX_JobHeader)); query.dataSourceTable(tableNum(ACX_JobHeader)).clearRanges(); 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(); }

Does any Buddy know the solution ?

Can you please use Insert > Insert code to paste source code? The thing above is unreadable, because it lacks line breaks and indentation.

By the way, I moved the extra keywords from the title to tags.

public void lookupJobCardType(FormStringControl control)
{
    SysLookupMultiSelectGrid    MSjobCardType;
    Query                       query;
    QueryBuildDataSource        qbds;
    counter                     counter;
     MSjobCardType           =   SysLookupMultiSelectGrid::construct(control,control);
    query                   =   new Query();

    qbds                    =   query.addDataSource(tableNum(ACX_JobHeader));

    query.dataSourceTable(tableNum(ACX_JobHeader)).clearRanges();

    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 UI Builder Lookup Method

Let me simplify it a bit, so it’s easier to follow.

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();
}