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 62,157 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,193 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

Can you answer this forum question?

You could make someone's day!

Community Newsletter - May 2024

Kudos to our community stars!

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283,671 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 224,756 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Featured topics

Product updates

Dynamics 365 release plans