Notifications
Announcements
No record found.
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
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.
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,
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).
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2