RelatedTableRole and Query JoinRelation

Posted: April 18, 2012 in AX

This section describes how you can use the RelatedTableRole property to simplify the creation of a new query.

Suppose that on a table relation you enter an explicit value for the RelatedTableRole property. You can then use that value to populate theJoinRelation property on a data source relation under an AOT > Queries > MyQuery node. This enables you to specify the fields of the join in only one location. If the join fields ever change, you must update the join in only one location.

Before you can set a value for the JoinRelation property, you must delete the values for the Field and RelatedField properties.

The following two images show how to use the JoinRelation property.

  1. First image – shows the properties on a table relation, and the value of the RelatedTableRole property is highlighted.

  2. Second image – shows the properties on a data source relation under a query. We see that the value for the JoinRelation property is a copy of the value for the RelatedTableRole.

RelatedTableRole property on a table relation.

The RelatedTableRole property on a table relation

In the next image we see the value for the JoinRelation property is a copy of the value for the RelatedTableRole from the previous image.

The JoinRelation property on a query relation

The JoinRelation property on a relation under a query

Leave a comment