Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Multiselect Dropdown f...
Finance forum
Suggested answer

Multiselect Dropdown field in D365 Finance and Operation

Posted on by Microsoft Employee

Hello Experts,

I want to add one field to my custom form which will be able to select multiple values from the dropdown. Those selected value is not going to database only it should appear in the form. I have seen some blogs but didn't get a clarity on it. please advise if there is any step by step blog for the same. in my case listed items are few (not more than10) so i can create it as enum like normal drop down item if possible.

i want something like this

multiselect2.png 

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: Multiselect Dropdown field in D365 Finance and Operation

    Hi, just look at the source code of LogisticsPostalAddress, and look where "rolesCtrl" is initialized. There you will see that the list comes from a query of Location roles. So, it needs to be a query that returns the list of values.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Multiselect Dropdown field in D365 Finance and Operation

    Hello Nikolaos ,

    Appreciate your quick response and continuous support , I have few more doubts , Kindly clear these too.

    Error73C.png

    the Purpose drop down list options are available like Business , Delivery, Consignment ..etc. , where and how  these list is created, and referenced to the form, I am not able to see them anywhere. 

    In my case my options list i have created as Enums , i don't  think this is emun. Please advise so that i can create my list same way.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: Multiselect Dropdown field in D365 Finance and Operation

    Hi Sachin,

    forceWriteDS simply writes the data source record.

    updateDeliveryTab shows / activates some controls, if Delivery role was among the selected roles.

    So, most likely neither of them are relevant for your implementation.

    Both of the mentioned EDTs are designed to hold a list of role names.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Multiselect Dropdown field in D365 Finance and Operation

    Hello Nikolaos,

    As you advised i am following "LogisticsPostalAddress" class to implement my multiselect dropdown. The field "purposes" is the exact same example  what i want to make my multiselect field.

    while i am following this , i found in form design there is a string control name "Roles"  overriding modified method in "LogisticsPostalAddress" class.

    Control field code below:

        [Control("String")]
        class Roles
        {
            public boolean modified()
            {
                boolean ret;
    
                ret = super();
    
                if (ret)
                {
                    element.forceWriteDS();
                    element.updateDeliveryTab(rolesCtrl);
                }
    
                return ret;
            }
    
        }
    

    Here two method " element.forceWriteDS()" and "updateDeliveryTab(rolesCtrl)" are referenced , can you please brief me what is the role of these method and in my scenario what method i need to referenced if any.

    Also there are two EDT.

    1. DirPartyAddressLocationRoleNames: Referenced in the “Roles” field properties.
    2. DirPartyLocationRoleNames: Extends in the properties of DirPartyAddressLocationRoleNames.

    what is the purpose of these two EDT. please mention your valuable comments.

    Thanks in advance 

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: Multiselect Dropdown field in D365 Finance and Operation

    Hi,

    the article about multiselect lookup in grid is applicable for you if your multiselect field is in a grid. So, based on the information that you shared: it's not relevant for you.

    As instructed earlier, just look at how the standard field in LogisticsPostalAddress is implemented. And also check Vinit's suggestions.

  • Suggested answer
    vinitgoyal2005 Profile Picture
    vinitgoyal2005 6,326 on at
    RE: Multiselect Dropdown field in D365 Finance and Operation

    Hi,

    look at Tutorial_LookupMultiSelectDialog class for your reference. you can also look at the references for SysLookupMultiSelectCtrl and check how it is implemented (e.g. CustAccountStatementIntUIBuilder -> billingClassificationLookup )

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Multiselect Dropdown field in D365 Finance and Operation

    Hello Nikolaos,

    I have seen many blogs most of them related to D365 CRM and AX , as per my requirement i found these two bit relevant.

    1.  link1

    2.Link2

    Both blogs follows different approach , i am following link 2 and i write a class  DrfSysLookupMultiSelectGrid and extend SysLookupMultiSelectGrid. in step 2 we need to Override the Lookup() method of form control. where i have to override this method exactly ?.

    Also please advice if the Link 2 is correct to follow as per my requirement  

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: Multiselect Dropdown field in D365 Finance and Operation

    You can check the dropdown for address purposes in LogisticsPostalAddress form and use it as an example.

    You said that you already found some blogs but "didn't get clarity". Perhaps you can let us know what blogs you found and what kind of problems you still have? Otherwise there's a risk that we will just repeat the infomation that you already found, and can't address your specific issues.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,263 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,112 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans