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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Why are table type classes are used?

(0) ShareShare
ReportReport
Posted on by 115
Hi experts, 
I am a Microsoft dynamics D365FO developer. I was trying to understand why do microsoft uses abstract table type classes for tables. For example, PurchTableType class and PurchLineType classes. Why isn't all those logics are written inside the table itself?. 
Should I also consider writting logics under type classes of my custom tables even if there are just minimal methods? 
Any points or blogs would help. 
Thanks in advance!
  • Verified answer
    Martin Dráb Profile Picture
    241,360 Most Valuable Professional on at
    This is rather an exception - there are just a few tables with classes like this.
     
    The reason is that the business logic is very complex and there are several distinct types of orders with specific behavior, such as PurchTableType_Project or PurchTableType_ReturnItem. The class hierarchy allows writing common logic either on the table or in the parent class, and other logic in child classes specific to the given type of order. The table makes polymorphic calls and the logic for the given type of order is executed. Putting all the logic directly on the table would result in very complicated methods and it couldn't utilize inheritance of common logic.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 543 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 415 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 188

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans