IT tutorials
 
Applications Server
 

Microsoft Dynamics AX 2009 : Design and Implementation Patterns (part 2) - Table-Level Patterns

11/22/2011 3:01:07 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

Table-Level Patterns

The patterns described in this section—the Find and Exists methods, polymorphic associations (Table/Group/All), and Generic Record References—apply to tables.

Find and Exists Methods

Each table must have the two static methods Find and Exists. They both take the table’s primary keys as parameters and return the matching record or a Boolean value, respectively. Besides the primary keys, the Find method also takes a Boolean parameter that specifies whether the record should be selected for update.

For the CustTable table, these methods have the following profiles.

static CustTable find(CustAccount accountNum, boolean _forUpdate = false)
static boolean exist(CustAccount accountNum)


Polymorphic Associations

The Table/Group/All pattern is used to model a polymorphic association to either a specific record in another table, a collection of records in another table, or all records in another table. For example, a record could be associated with a specific item, all items in an item group, or all items.

You implemented the Table/Group/All pattern by creating two fields and two relations on the table. By convention, the first field’s name has the suffix Code, as in ItemCode. This field is modeled using the enum TableGroupAll. The second field’s name usually has the suffix Relation, for example, ItemRelation. This field is modeled using the extended data type that is the primary key in the foreign tables. The two relations are both of the type Fixed field relation. The first relation specifies that when the Code field equals 0 (TableGroupAll::Table), the Relation field equals the primary key in the foreign master data table. The second relation specifies that when the Code field equals 1 (TableGroupAll::Group), the Relation field equals the primary key in the foreign grouping table.

Figure 1 shows an example.

Figure 1. A polymorphic association


Generic Record Reference

The Generic Record Reference pattern is a variation of the Table/Group/All pattern. It is used to model an association to a foreign table. It comes in three flavors: (a) an association to any record in one specific table, (b) an association to any record in a fixed set of specific tables, and (c) an association to any record in any table.

All three flavors of this pattern are implemented by creating a field using the RefRecId extended data type.

To model an association to any record in one specific table (flavor a), a relation is created from the RefRecId field to the foreign table’s RecId field, as illustrated in Figure 2.

Figure 2. An association to one specific table


For flavors b and c, an additional field is required. This field is created using the RefTableId extended data type. To model an association to any record in a fixed set of specific tables (flavor b), a relation is created for each specific foreign table from the RefTableId field to the foreign table’s TableId field, and from the RefRecId field to the foreign table’s RecId field, like shown in Figure 3.

Figure 3. A association to any record in a fixed set of tables


To model an association to any record in any table (flavor c), a relation is created from the RefTableId field to the generic table Common TableId field and from the RefRecId field to Common RecId field, as shown in Figure 4.

Figure 4. An association to any record in any table

 
Others
 
- Microsoft Dynamics AX 2009 : Design and Implementation Patterns (part 1) - Class-Level Patterns
- BizTalk 2009 : Creating More Complex Pipeline Components (part 4) - Custom Disassemblers
- BizTalk 2009 : Creating More Complex Pipeline Components (part 3) - Validating and Storing Properties in the Designer
- BizTalk 2009 : Creating More Complex Pipeline Components (part 2) - Schema Selection in VS .NET Designer
- BizTalk 2009 : Creating More Complex Pipeline Components (part 1) - Dynamically Promoting Properties and Manipulating the Message Context
- Microsoft Dynamics GP 2010 : Tailoring SmartLists by adding Fields
- Microsoft Dynamics GP 2010 : Controlling data with SmartList Record Limits
- Upgrading and Configuring SharePoint 2010 : Configuring a content database
- Upgrading and Configuring SharePoint 2010 : Creating and associating content databases to a specific web application and site collection
- Administering Active Directory Domain Services : Working with Active Directory Snap-ins (part 2) - Saving and Distributing a Custom Console
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us