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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Multi select combobox using enums...

(0) ShareShare
ReportReport
Posted on by

Is it possbile? As far as i know it's possible with a query;

   msCtrl = SysLookupMultiSelectCtrl::construct(element, TestCtrl, querystr(StudentCourse)); etc...

Regards

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Denis Macchinetti Profile Picture
    16,444 on at

    Hi

    As I know, isn't possible.

    What you can do is exclude some values with the SysFormEnumComboBox class.

    A workaround could be use a tmp table, fill with the enum values and use the SysLookupMultiSelectCtrl Class.

  • Suggested answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Lookups are all about queries. Nevertheless you can fill a temporary table with enum values and use it an a query. SysLookupMultiSelectCtrl offers constructWithQueryRun() factory method for scenarios with a temporary table.

  • CU13051429-0 Profile Picture
    351 on at

    Hi Martin

    I have to use tmp table ( either tmp or in momory ) for SysLookupMultiSelectCtrl

    using below code

    MyTempTable.setTmpData(element.populateTmpTable);

    queryRun = new QueryRun(queryStr(MyTempQuery));

    //AOT MyTempQuery query which has MyTempTable as datasource

    queryRun.setCursor(MyTempTable);

    msCtrlCust = SysLookupMultiSelectCtrl::constructWithQueryRun(element, control,queryRun);

    Temporay table are population as i have ran the same cod to fill MyTempTable ( making it regular table)

    after execution able to see inserted rows. and also with regular table type SysLookupMultiSelectCtrl is showing records in multiselectcontrol too.

    However if i change table type to tmp or inmomory then same code showing no records in multiselectcontrol.

    Please suggest.

  • Suggested answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    You're not using constructWithQueryRun() correctly - you have to provide a value for _selectField parameter in this case. For example:

    msCtrlCust = SysLookupMultiSelectCtrl::constructWithQueryRun(
        element,
        control,
        queryRun,
        false,
        [tablenum(MyTempTable), fieldNum(MyTempTable, MyField)]);


  • CU13051429-0 Profile Picture
    351 on at

    Thanks for Reply Martin.

    I have added container for select field however there is no records at UI.

    while debugging , form data source has no records ( no of loaded records)

    SysLookupMultiSelectGrid at this class level

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    I'm sorry, but I don't have enough information to tell you where you have done something wrong. Ensure yourself that you fill the temporary buffer with data, that your query is correct (e.g. Fields node has Dynamic property set) and if you don't see anything wrong. debug the code.

  • Suggested answer
    YuliaK Profile Picture
    10 on at

    Try this:

    MyTempTable = element.populateTmpTable;

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans