web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Finding variable names dynamically

(0) ShareShare
ReportReport
Posted on by 5

Hi there, 

i set a filter on a a record and for each record i need to set a specific Boolean to true or false.


Now the problem is that there are many booleans! Is there a way to assigned variables dynamically?

Basically what i'm asking is: are there variable variable-names?

Background: the property ShowMandatory on a page field is set through variables on the Item Card. And as you know: The Item Card got many fields by default.

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    Maybe recordref is what you are looking for?

    learn.microsoft.com/.../recordref-data-type

    That lets you dynamically access any field in any table in BC.

  • Suggested answer
    YUN ZHU Profile Picture
    98,345 Super User 2026 Season 1 on at

    Hi, There is a simple example in method 3 below, hope will give you some hints.

    Using RecordRef Data TypeFieldRef Data Type and Field table.

    https://yzhums.com/28900/

    Thanks.

    ZHU

  • fudgi Profile Picture
    5 on at

    thx for your answer, but i think it wouldn't help me setting all the different variables in a more comfortable way:

    pastedimage1666249055441v1.png
    each field has its own variable, because they can each have a different state in my scenario.

    that's why i thought there might be a way of saying "isfield<variable>Mandatory := checkMandatoryState();".


  • Suggested answer
    DAnny3211 Profile Picture
    11,407 Super User 2026 Season 1 on at

    hello

    what you would like to do would have been possible if the shomandatory property had accepted functions.

    but the shomandatory property cannot validate an AL function.

    greetings

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,986 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,071 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 975 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans