English 中文(简体)
How to find a table name by ID in Dynamics AX
原标题:

Each table in the AOT has an ID, how can I discover the table name given an ID?

问题回答

Looking at the SQL dictironary is really the correct method. Search for the line with the FieldId equal to 0. Using TSQL this will tell the name of the table for tableid 505

select NAME 
  from SQLDICTIONARY
 where TABLEID = 505
   and FIELDID = 0

From X++, use the tableId2Name function.

From the GUI, choose Tools/Development tools/Application objects/Application objects and filter for a recordType of TableInternalHeader and a parentId of the table id you are looking for.

Or in the AOT, right click on Tables and choose Find. On the Name & Location tab, set Search to All nodes. On the Properties tab click Selected next to ID and fill in the table id in the Range field.

I dont know if this is your answer, if you want to give the TableName with his ID, you can use the method: str tableId2Name(int _tableid)

For example: If YourTable has ID :123456 ; use method

       tableId2PName(123456) 

will return the str name YourTable.

info(strFmt("%1" , tableId2PName(123456))); -> VideoStamp the name.

I used the info in https://msdn.microsoft.com/en-us/library/aa498759.aspx

I hope to useful , greetings!

If you need AX system table name you can use tableId2name or DictTable.name method.

If you need SQL table name you shoud use DictTable.name method with first argument of DbBackend::Sql

Example:

print new DictTable(tableNum(DirPartyTable)).name(DbBackend::Sql);
print new DictTable(tableNum(OMOperatingUnit)).name(DbBackend::Sql);
pause;

// result:
// DIRPARTYTABLE
// DIRPARTYTABLE

Or you can try:

select  Name, AxId
from MicrosoftDynamicsAX_model.dbo.ModelElement (nolock) 
where ElementType = 44
order by AxId

In the AOT, go to the System Documentation node. In the Tables node, find SqlDictionary and open it with the table browser. Filter the column TabId with your ID.

In the AOT, go to the System Documentation node. In the Tables node, find SqlDictionary and right click and open it with the table browser. Filter the column TabId with your ID and fieldid == 0, his will give you the name of the table.

Easiest way:

  1. Create a project (not necessary but easier to delete later)
  2. Add a new view to your project
  3. Add the data source SqlSyncInfo
  4. Drag the fields ID, MessageType, SyncTable, TableName, etc to field
  5. Open the view

It provides all the table names and their respective IDs. Just filter what you want. If you know the table ID, search for that. If you know the table name, search for that.





相关问题
Axapta: Programmatically switch records in a form

In Dynamics AX 2009, how do you programmatically change to a different record in a form? My form contains a treeview and a group of bound data fields. When clicking on a record in the tree (the data ...

Dynamics AX 2009 - Duplicate IDs

We are in the process of merging projects from different AX Servers into source control on the same AX server. However, a few object IDs are common between projects, so Dynamics throws an error when ...

How to show a row total amount by group CG Group in Report

I am using Axapta 3.0 with language X++. I am making a report based on available report. The new report only shows a total row by group CG Group instead of showing all detail row as old report. Exam:...

Axapta: Form lifecycle question

I am attempting to manually populate an image icon into a window nested in a grid. In the run event, the fields don t appear to have values yet. The string control always returns an empty value. Is ...

How to reference a report datasource table using x++

I m unable to find the proper syntax for referencing the CustInvoiceTrans table of the SalesInvoice report datasource. Here s the context: I ve created a new classification field on the ...

axapta thread / animation

i have a function which costs plenty of time. this function is an sql-query called via odbc - not written in x++, since the functional range is insufficient. while this operation is running, I want ...

Axapta Validation Class

I ve written a method to handle regex validation in AX2009. Problem is that it always returns false, no matter what the expression or input string. Returns no errors, just false Mind taking a ...

ERP What to read/practice?

I had been learning ERP applications this summer during internship. As I am a programmer about to graduate, I want to have a solid software branch that would get me through till I am sure about what ...

热门标签