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

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
    antmas 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
    antmas 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
    Muaaz Deyab 29 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
    YUN ZHU 78,198 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
    antmas 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
    Nitin Verma 21,341 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
    YUN ZHU 78,198 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
    DAnny3211 9,274 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,575 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans