Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

ValuesAllowed (field) Property

(0) ShareShare
ReportReport
Posted on by 60

Community,

I've seen that the ValuesAllowed Property is Non-Customizable.

Has anyone found an effective workaround to this limitation?

I was hoping to use this to filter a list of ENUM choices based on user selections made elsewhere.

It'd be nice to be able to manipulate this like the VISIBLE Property, for which we can have it match a Boolean elsewhere (I know that ValuesAllowed isn't boolean).

Thanks,

Anthony

  • antmas Profile Picture
    60 on at
    RE: ValuesAllowed (field) Property

    Muaaz,

    Thanks for the suggestion.

    Perhaps I am missing something, but I don't see where the allowable selections become dynamic.

    Based on the docs and multiple replies, it doesn't seem doable.

    Thanks for the suggestion.

    -Anthony

  • antmas Profile Picture
    60 on at
    RE: ValuesAllowed (field) Property

    ZHU,

    This seems like wise advice, and I will consider it if I cannot find another way to accomplish the same goal.

    Thanks again,

    Anthony

  • Verified answer
    Muaaz Deyab Profile Picture
    39 on at
    RE: ValuesAllowed (field) Property

    I think you can create new Enum and field and map them to the original ones like This:

    enum 90000 MyEnum

    {    /// create enum with the same values of the original One

       Extensible = true;

       value(0; MyValue)

       {

       }

       value(1; MyValue1)

       {

       }

       value(2; MyValue2)

       {

       }

    }

    tableextension 90000 MyExtension extends Customer

    {

       fields

       {

           field(90000; MyField; Enum MyEnum)

           {

               DataClassification = ToBeClassified;

               ValuesAllowed = 1, 2;  // add the allowed values here

               trigger OnValidate()

               var

                   myInt: Integer;

               begin

                   rec.Validate("original Field", MyField);   // validate the original field  

               end;

           }

       }

       var

           myInt: Integer;

    }

    I don't know if it is a good solution, just trying to help.

  • Suggested answer
    YUN ZHU Profile Picture
    84,670 Super User 2025 Season 1 on at
    RE: ValuesAllowed (field) Property

    Hi, If there are too many values in your Enum, I suggest not to use the Enum type, but consider creating a table to manage them. In this way, more things can be done in permission or code.

    Hope this helps.

    Thanks.

    ZHU

  • antmas Profile Picture
    60 on at
    RE: ValuesAllowed (field) Property

    ZHU,

    Before posting my question, I did consider your method (saw it in a separate post / answer).

    That seems like a good solution for some cases.

    However, in my situation, there are too many possible Enum outcomes to make a field for each.

    Thanks as always for the thoughtful reply,

    Anthony

  • Nitin Verma Profile Picture
    21,567 Moderator on at
    RE: ValuesAllowed (field) Property

    Hi,

    This is property not available to customize, you can customize your solution to achieve the requirement.

  • Suggested answer
    YUN ZHU Profile Picture
    84,670 Super User 2025 Season 1 on at
    RE: ValuesAllowed (field) Property

    Hi, The only solution now is to add repeated Enum fields on the page, then set different ValuesAllowed Properties for them, and then control which value is displayed through the conditions of the Visible property. . . It's a little troublesome. . . .

    pastedimage1676939771139v1.png

    Hope this helps.

    Thanks.

    ZHU

  • DAnny3211 Profile Picture
    9,278 Moderator on at
    RE: ValuesAllowed (field) Property

    hi

    it's non-customizable

    learn.microsoft.com/.../devenv-valuesallowed-property

    DAniele

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans