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...
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,111 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
    95,741 Super User 2025 Season 2 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,397 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

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 2,066

#2
YUN ZHU Profile Picture

YUN ZHU 658 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 595

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans