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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to get all column data of DirPartyTable use x++ ?

(0) ShareShare
ReportReport
Posted on by

I want to get data of all column in DirPartyTable use x++, but I don't know how to join inherited table to get info

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    You can right click the table > Add-ins > Table type hierarchy browser.

    That will give you what other tables are extending it.

    To return all columns, you could for example create views, where you join DirPartyTable as top level table and the extending table as a child datasource, then include the fields which you want to see. After that you could simply just do a select statement on the view in X++.

    You could also just use an inner join between the tables using the relation defined between them.

    Also fields are visible directly for all parents when you do a select statement on the child, like you could get DirPerson.AccountNum event though that field is for the parent.

    If these do not answer your question, please clarify what do you want to do.

  • Community Member Profile Picture
    on at

    Hi Vilmos Kintera,

    Can you show me solutions in detail, that only use X++ to join inherited table of DirPartyTable, cause I don't know how to catch info of relation between table

    thank you,

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at
    static void WIK_getDirPartyDetails(Args _args)
    {
        DirPerson           dirPerson;
        DirPartyTable       dirPartyTable;
        
        select firstOnly RecId, PersonalTitle, NameAlias from dirPerson
            where dirPerson.PersonalTitle   != 0
                && dirPerson.NameAlias      != '';
        
        info(strFmt('DirPartyTable.NameAlias = %1, DirPerson.PersonalTitle = %2',
            dirPerson.NameAlias,
            HcmTitle::find(dirPerson.PersonalTitle).TitleId));
    
        select firstOnly RecId, NameAlias from dirPartyTable
            where dirPartyTable.NameAlias   != ''
            join PersonalTitle from dirPerson
                where  dirPerson.PartyNumber    == dirPartyTable.PartyNumber
                    && dirPerson.PersonalTitle  != 0;
                
        info(strFmt('DirPartyTable.NameAlias = %1, DirPerson.PersonalTitle = %2',
            dirPartyTable.NameAlias,
            HcmTitle::find(dirPerson.PersonalTitle).TitleId));
        
    }
    As you can see they will give the same result (if you have values populated correctly).
  • Verified answer
    Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    Use DirPartyTable in your select statement and then downcast it to a specific subtype to access its fields (e.g. party as DirPerson). You can recognize here the usual concepts of object-oriented programming.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans