Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Dynamically reading Table and field properties using Web Services

Posted on by Microsoft Employee

How can I programmatically read read Table and field properties such as field names, types and lengths using Web Services?

Thanks in advance,

Ricardo Talbot
IRISCO

*This post is locked for comments

  • Neville Foyn Profile Picture
    Neville Foyn 4,320 on at
    Re: Dynamically reading Table and field properties using Web Services

    Happy to help, shout if you start down this path and run into any problems and i can assist,

    You will need two different codeunit functions, the first will be a "Retrieve tables" function with a parameter of a XML port pointing at the "Table Information" table or possibly the "Object" table and any fields to pass filters in separate fields, you pass in the filters and the XML port returns the tables details

    The second function will also have a XML port pointing at the Field table and returning fields based on the table filter passed

    Any additional information you need like keys, option string & so on you can retrieve using the field ref & table ref

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Dynamically reading Table and field properties using Web Services

    Thanks Neville,

    I'm definitely going to explore that approach.

    Ricardo.

  • Verified answer
    Neville Foyn Profile Picture
    Neville Foyn 4,320 on at
    Re: Dynamically reading Table and field properties using Web Services

    Hi

    Yes you can, there will be a few steps though,

    I am guessing you would be wanting to pass a table name to nav and get a list of fields and properties back?

    If so the best way would be to create a codeunit and XML port combination, the codeunit will take a parameter of table name and pass back a set of fields & Table is required with their properties

    You can get to these fields and properties by using a RecordRef & FieldRef variable in the codeunit combined with the Field dynamic table to get a list of all the fields in a table to loop through

    Hope this makes sense,

    Cheers

    Neville

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans