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, ...
Suggested answer

xRecord class and common class

(0) ShareShare
ReportReport
Posted on by 28

hi all,

please let me know the xRecord class and common class . i saw the classes are used in stnd. code.

please let me know what is the different between both classes? and when  to use?

i refereed this,but not clear

https://docs.microsoft.com/en-us/previous-versions/dynamics/ax-2012/reference/aa625830(v=ax.60)?redirectedfrom=MSDN 

please elaborate me

I have the same question (0)
  • Sukrut Parab Profile Picture
    71,699 Moderator on at
    RE: xRecord class and common class

    If you are looking for example , you can find plenty of examples in the application  if you do metadata search,  one such a example  you can check is  from application class log inert method. There are plenty of methods on the same class which uses common.

  • Blue Wang Profile Picture
    on at
    RE: xRecord class and common class

    Hi @rp@n,

    The link you see is a bit old, you can combine to look at this system table https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-ref/system-tables#del_companydomainlist

    you will find:

    The Common table is the base class for all tables. It does not contain any data. It is primarily used in X++ code to refer to any table in a polymorphic way.

    Inheritance Hierarchy of Common table is xRecord Class Common Table.

    The inheritance Hierarchy of all other system tables is xRecord Class Common Table (othertablename) Table.

  • Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: xRecord class and common class

    I assume you mean "ID" instead if "I'd" and "right" instead of "rite".

    If you mean that you can have a method accepting a record of any table (by declaring the parameter as Common), than it's correct. If you  know a little bit about object-oriented programming, it should be very familiar.

  • nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: xRecord class and common class

    Not really.

  • @rp@n Profile Picture
    28 on at
    RE: xRecord class and common class

    Nikoloas,

    Some time we don't know the table I'd or field I'd if any tables. So, with help of common , we can pass the parameters of table I'd and get the value of ( recid ) of actual table. Then we can manipulate that table as per requirement.  

    Is it rite?

  • Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: xRecord class and common class

    That's surely not standard code. It's seems to be a job and the code doesn't do anything useful. We can't explain to you code that makes no sense.

  • nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: xRecord class and common class

    Could you please use Rich text formatting - Insert - Code when you share your code?

    Other than that, I don't have anything to add, except to read my previous messages.

  • @rp@n Profile Picture
    28 on at
    RE: xRecord class and common class

    Nikoloas,

    static void DataDic_Common(Args _args)

    {

    Common common;

    CustTable custTable;

    ;

    common = custTable;

    if (common.tableId == tablenum(custTable))

    {

    while select common

    {

    info(common.(fieldnum(custTable, name)));

    }

    }

    }

    Let me know why common is used? We can loop directly CustTable rite?

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: xRecord class and common class

    I already gave you an example in my first reply.

    Since you said that you found standard code where Common is used, perhaps you can go where you saw it, and try to figure out how it works. And if you need our help in that, just let us know what code it was.

    Thanks!

  • @rp@n Profile Picture
    28 on at
    RE: xRecord class and common class

    Nikolas,

    Please give me an example of common table. So, that I can understand properly

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 764 User Group Leader

#2
Martin Dráb Profile Picture

Martin Dráb 619 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans