Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
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 73,696 Super User 2024 Season 2 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,203 Super User 2024 Season 1 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!

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans