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 :
Finance | Project Operations, Human Resources, ...
Answered

Problem in Multi selection lookup parameter name

(0) ShareShare
ReportReport
Posted on by 33

when i select my multi selection lookup dialog it show in integer (0;1;2.....) but in my case i want it to show as high, urgent, low etc .

the blow picture will explain what i am trying to say.

i have used UI builder class for multi selection is working correctly.

can anyone help with code to meet my problem?

I have the same question (0)
  • Verified answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, If you are using UI builder class then please check this article

    ariste.info/.../

  • Mian Shabir Ahmad Profile Picture
    33 on at

    Hi Mr. Mohit Rampal

    thanks for Repay, my UI builder class working well, but in parameter when i select High, Medium, it show (1;2) and I want (High; Medium)

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, Have you tried replicating the code mentioned in the article? As you can see in the article, the selected values in multi select lookup is returning as String. If still issues, please share your code.

  • Mian Shabir Ahmad Profile Picture
    33 on at

    Hi Mohit Rampal ,

    here is my code snippet.

    class DemoMultiLookupUIBuilder extends SysOperationAutomaticUIBuilder

    {

       OCMS_PurchReqContract   contract;

       DialogField        Dialogpriority;

       public void postBuild()

       {

           contract = this.dataContractObject() as OCMS_PurchReqContract;

           Dialogpriority = this.bindInfo().getDialogField(contract, methodStr(OCMS_PurchReqContract, parmPriority));

           Dialogpriority.lookupButton(FormLookupButton::Always);

       }

       public void postRun()

       {

           Query            query        = new Query();

           QueryBuildDataSource    qbdsLegalEntity     = query.addDataSource(tablenum(PurchReqLine));

           qbdsLegalEntity.fields().addField(fieldNum(PurchReqLine, Priority));

           qbdsLegalEntity.addGroupByField(fieldNum(PurchReqLine, Priority));

          // qbdsLegalEntity.fields().addField(fieldNum(PurchReqLine, Name));

           container selectedFields = [tableNum(PurchReqLine), fieldNum(PurchReqLine, Priority)];

           SysLookupMultiSelectCtrl::constructWithQuery(this.dialog().dialogForm().formRun(), Dialogpriority.control(), query, false, selectedFields);

       }

    }

  • Mian Shabir Ahmad Profile Picture
    33 on at

    Here is the output of that code.


  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Your code looks fine but not sure what's the issue here. Can you try below article, this should work as its storing the values in list getFromDialog method and displaying string later

    dynamicsaxforall.blogspot.com/.../multiselect-lookup-on-dialog-in-ui.html

  • Verified answer
    GirishS Profile Picture
    27,827 Moderator on at

    Hi Mian,

    Is Priority is the Enum field?

    If it's an Enum field, you will get in numbers only.

    Thanks,

    Girish S.

  • Mian Shabir Ahmad Profile Picture
    33 on at

    Hi GirishS

    Correct but if some one need then?

  • Verified answer
    GirishS Profile Picture
    27,827 Moderator on at

    I think it will be better if you create a table for that to store an Enum elements as string value and use that table in a multiselect lookup query.

    Thanks,

    Girish S.

  • Mian Shabir Ahmad Profile Picture
    33 on at

     GirishS 

     Mohit Rampal 

    thamks both of you

    I Create a table and store an Enum element as Sting value, its worked.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans