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 :
Small and medium business | Business Central, N...
Answered

How do I create a new field that uses a multiple select dropdown menu?

(0) ShareShare
ReportReport
Posted on by 183

Goal: My contact wants to be able to create a dropdown menu where you can have multiple options selectable and storable for this custom field. We would like this to be applied to the Item Card header.

pastedimage1665107373344v1.png

End goal concept

Alternatively, they would like to create about ten dropdown fields in Business Central while keeping the use of purchases to a minimum if the above goal is currently unattainable.

We have in mind that the ten dropdown fields will contain varying multiple different options and each option will be unique and will differ from each other dropdown field.

Please also be aware that I am of a low code/non-developer background.
Any help is much appreciated.

I have the same question (0)
  • DAnny3211 Profile Picture
    11,397 on at

    Hi

    My idea would be as follows:

    create a table where all possible values of the new field will be entered.

    Hook the new field with a Lookup AL to the page of the table of possible values, so as to make a multiple selection, and insert in the new custom field the selected values as in the example:

    Value1|Value2..Value3|Value4

    in order to retrieve the values from the custom field you would have to make a function that parse the string.

    You can take the Totaling field of the G/L Account as a reference and see on the G\L Account Card page the code under the Lookup of the Totaling field:

    "GLAccountList.LOOKUPMODE(TRUE);

    IF NOT (GLAccountList.RUNMODAL = ACTION::LookupOK) THEN.

     EXIT(FALSE);

    Text := OldText + GLAccountList.GetSelectionFilter;"

    Greetings

    DAniele

    create a field similar to the TOtaling of the G/L Account

  • DAnny3211 Profile Picture
    11,397 on at

    Hi

    I would add that in order to retrieve the field values with the example string Value1|Value3..Value4|Value2

    you will just need to create a function that filters the table with all possible values and insert them where needed for example in a print report or page

    DAniele

  • Amit Profile Picture
    2,557 on at

    Hi,

    Adding info-:

    https://erpconsultors.com/creation-of-table-in-dynamics-365-bc/

    Regards

    Amit Sharma

    www.erpconsultors.com

  • YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 on at

    Hi, Just to add an example for Daniele's idea.

    How to get a filter for the selected records on any page (For example, ‘1..3|6’)

    https://yzhums.com/27561/

    Hope this helps.

    Thanks.

    ZHU

  • Joseph.Candava Profile Picture
    183 on at

    Thanks for this response.

    I made the attempt of writing up something that uses the "Purchasing Codes" as the lookup page to base my selections off as the variable PurchaseCodeList.

    layout
        {
            addlast(InventoryGrp)
            {
                field(MyField; Rec.MyField)
                {
                    ApplicationArea = all;
    
                    trigger OnLookup(var Text: Text): Boolean
                    var
                        PurchaseCodeList: Page "Purchasing Codes";
                    begin
                        PurchaseCodeList.LookupMode(true);
                        if not (PurchaseCodeList.RunModal() = Action::LookupOK) then begin
                            Clear(Rec.MyField);
                            exit(false);
                            Text := PurchaseCodeList.GetSelectionFilter;
                        end else begin
                            exit(true);
                        end;
                    end;
                }
            }
        }

    I am currently having the problem where I am trying to add this portion of the code in my .al file but it is giving me an error message in the Problems console output tab: 'Page "Purchasing Codes"' does not contain a definition for 'GetSelectionFilter'

    Text := PurchaseCodeList.GetSelectionFilter;

    I have seen seen the source https://yzhums.com/27561/ to see how to get the GetSelectionFilter to work but I am unsure how to obtain the GLAccountList.Page.al or how to produce one myself.

    I have attempted to create a file containing codeunit 46 selectionFilterManagement with my current VSCode settings but I am still getting the same 'Page "Purchasing Codes"' does not contain a definition for 'GetSelectionFilter' error after confusing myself that I thought that I have provided this definition with this file.

    At the moment, I have gotten the Purchasing Codes page to show on the drop down menu but selecting a single or multiple values does not return the selection in the text box of my field.
    Completely appreciated the help so far.

  • Suggested answer
    Joseph.Candava Profile Picture
    183 on at

    Since I was unable to create the multiple select drop down menus, I have opted for the ten individual Option Lists (Enum) described in this source: https://yzhums.com/5985/  as I spent way too much time attempting to get a Lookup list (Multi Select) solution to work where I recall the equivalent of the Text += PurchaseCodeList.GetSelectionFilter(); was pulling up an error against the specific "Purchase Code List" page saying that GetSelectionFilter was not recognised as an existing function. I looked up how to rebuild GetSelectionFilter to work for the Purchase Code List page indicated here https://yzhums.com/27561/ but I was unsuccessful and ended up confused following this guide.

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans