Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

finding the id of a field using the field name only by using the recref and fieldref

Posted on by
I want to find the field id using its name (only thing that I know about it). How do I do that using the recref and fieldref
Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 64,622 Super User on at
    finding the id of a field using the field name only by using the recref and fieldref
    Hi, hope the following can give you some hints.
    How to get the id, type, length and value of a field by its text name (field name)



     
    Thanks.
    ZHU
  • Suggested answer
    Govinda Kumar Profile Picture
    Govinda Kumar 2,197 Super User on at
    finding the id of a field using the field name only by using the recref and fieldref
    In an alternate approach, you can utilize the Field table to find the Field ID by setting a range on the Field Name... here's the example code..
        var
            Fieldlist: Record Field;
        begin
            Fieldlist.SetFilter(FieldName, 'YourFieldName');
            if (Fieldlist.FindSet()) then
                Message('Field No. is %1', Fieldlist."No.")
        end;
    Additionally, you can specify the table name before the Field Name filter..
    Regards!

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,768 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,985 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans