web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Get Table Id and Field Ids of D365 F&O Table through SQL query

(0) ShareShare
ReportReport
Posted on by 758

Hi Everyone,

Using below SQL query I can get the Table Id,

select * from SysTableIdView where Name = 'CustTable'

Can anyone please help me with SQL query to get field Ids of all fields of a particular table? This is possible and I have done this long time back, so unable to recall it.

I don't want to fetch field Id of a single field. I want the list of all field names and their IDs.

Thank you in advance.

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Get Table Id and Field Ids of D365 F&O Table through SQL query

    Table and field IDs are technical IDs that are intended for D365 internal usage. As long as you're working inside D365, you can use the mentioned views in x++ to get the info. And if you're working outside D365, then table and field ids should be irrelevant.

    Please let us know what is your functional requirement. Thanks!

  • Martin Dráb Profile Picture
    235,999 Most Valuable Professional on at
    RE: Get Table Id and Field Ids of D365 F&O Table through SQL query

    Why would you do that?

    Please tell us what you're trying to achieve from business point of view. We can't suggest a meaningful technical design without knowing what you need to achieve.

  • Rhushikesh R Profile Picture
    758 on at
    RE: Get Table Id and Field Ids of D365 F&O Table through SQL query

    Hi Andre,

    Then how could we identify the IDs for UAT and Production environment? As we don't have SQL access of UAT and Production in D365, do I need to write X++ job for same?

  • André Arnaud de Calavon Profile Picture
    297,830 Super User 2025 Season 2 on at
    RE: Get Table Id and Field Ids of D365 F&O Table through SQL query

    Hi Rhushikesh,

    A small additional comment. Note that the IDs can be different in each environment.

  • Rhushikesh R Profile Picture
    758 on at
    RE: Get Table Id and Field Ids of D365 F&O Table through SQL query

    Thank you Nikolaos for quick response.

    I am able to fetch field Ids with below query now.

    select * from SysTableFieldIdView where SysTableFieldIdView.Id = '77'

    In above Query,  SysTableFieldIdView.Id (77) is a Table Id

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Get Table Id and Field Ids of D365 F&O Table through SQL query

    Try SysTableFieldIdView.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 841 User Group Leader

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 753 Super User 2025 Season 2

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 566

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans