Skip to main content
Business Central forum
Suggested answer

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

editSubscribe (0) ShareShare
ReportReport
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:
Attachments
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 60,263 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,191 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

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,183 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,733 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans