Administering Filter Relationships

Aptify provides the ability to create a view in one service while filtering on fields that are related to another service. This allows a user to provide a view of one entity's records when only the filtering criteria from another related service is known. For example, if a user needs to access a group of Order records that were used to purchase a particular product, then the user must select the Products service to filter the search in the Orders service. Once linked to other entities, all of the fields within that entity are available as filter criteria for a view. In the example mentioned above, all of the fields within the Products service become available for further filtering criteria for the Orders view. Only the current service's records populate the generated view from the Find dialog box. For example, an Order-based search using Products service fields to filter the search always provides a view of Order records.

The associations that are used to tie these entities together for viewing purposes are called Filter Relationships. These relationships are added and edited from the Filter Relationships sub-tab on the Configuration tab of the Entities form.

This topic covers the following sub-topics:

Disabling Standard Filter Relationships

By default, all entities support three standard filter relationships:

  • Record History: Users can filter records in a service based on Record History information.
  • Lists: Users can filter records based on Lists to which these records belong.
  • Topic Codes: Users can filter records based on characteristics of associated Topic Codes.

These relationships appear in the Services drop-down list in a view's Filters dialog, as shown below.

.  Standard Filter Relationships
An administrator can disable one or more of these standard filter relationships as desired. Follow these steps:

  1. Open an Entities record.
  2. Click the Configuration > Filter Relationships tab.

    Managing Standard Filter Relationships
  3. Clear the check box for one or more of the standard filter relationships.
  4. Save and close the Entities record.

The Record History, Lists, and Topic Codes filter relationships are visible in a service's filter dialog for administrative users, even if these options have been cleared in the service's Entities record. 

Configuring New Filter Relationships

There are two types of filter relationships that may be configured within Aptify: One-to-Many and Many-to-Many. Each type of relationship is configured for the purpose of allowing users to search a view on the base entity using criteria from the related entity. The way each relationship type is configured is slightly different.

This topic contains the following sub-topics:

Setting Up One-To-Many Filter Relationships

In a one-to-many relationship, the base entity record can be linked to many related entity records, but the related entity record may only be linked to one base entity record. For example, an organization require the ability to search for persons who are the Ship To persons for orders taken. One person may be the ShipTo person for many orders, but each order has only one ShipTo person, which indicates that this must be a one-to-many relationship.

To provide this ability, a filter relationship is configured for the Persons entity to allow the user to use the ShipToID column from the Orders entity to filter a Persons view. This relationship is designed to allow the user to filter on orders where the ShipToID equals PersonID. The Persons entity includes this filter relationship by default.

A second example of a one-to-many relationship is the association between dashboard areas and dashboard parts. A dashboard area can have many dashboard parts, but a dashboard part can only be associated with one dashboard area.

Follow these steps to create this type of one-to-many filter relationship:

  1. Open a new Relationships form from the Entities form for the base entity (located in the entity's Configuration > Filter Relationships tab).
    • For example, open a new Relationships form for the Dashboard Areas entity.

      One-to-Many Filter Relationship
  2. Select the Related Entity from the list (such as the Dashboard Parts entity). Once this is selected, the Related Field list populates with all fields in the entity specified as the Related Entity.
  3. Select the Related Field. This is the field in the related entity that is linked to the base entity (such as the DashboardAreaID field in the Dashboard Parts entity that links parts to areas).
  4. Set the Relationship Type to One-To-Many.
  5. Enter a description. This description displays in the list of related entities when setting up a filtered view or search for the base entity.
  6. Click OK to close the Relationships form, then save the Entities record.

One-to-many relationships are also known as direct relationships, because the two entities have a direct link. In the example shown in the figure above, the DashboardAreaID field in the Dashboard Parts entity, which is designated as the Related Field, maps directly to the ID field in the Dashboard Areas entity. 

Setting Up Many-to-Many Filter Relationships

With many-to-many relationships, the base entity can be linked to many related entity records, and the related entity records can be linked to many base entity records. For example, an organization may require the ability to search for persons who have been assigned a particular function. Because each person can have many functions and each function could be linked to many persons, there is a many-to-many relationship between the Functions and Persons entities.

Many-to-many filter relationships are similar to one-to-many relationships in that the administrator must specify the Related Entity and Related Field. For many-to-many filter relationships, however, additional information must be specified. The Join Field and Join Table fields on the Filter Relationships form are only relevant when setting up many-to-many relationships between entities. For this example, the filter relationship between the Persons and Functions entities requires the join table vwPersonFunctions (which is also the base view for the PersonFunctions sub-type entity).

You may need to create a new join table to support your Many-to-Many Filter Relationship. This table should be added as a view to the Database Objects service. You may want to review the filter relationships and corresponding join tables provided by Aptify before attempting to create one of your own.

  1. Open a new Relationships form from the Entities form for the base entity (located in the entity's Configuration > Filter Relationships tab).

      Many-to-Many Filter Relationship
  2. Select the Related Entity from the list.
  3. Set the Relationship Type to Many-To-Many.
  4. Enter the name of the table that defines the link between the two entities in the Join Table field.
  5. Enter the name of the field within the Join Table that links the Join Table to the base entity into the Related Field field.
    • For example, when creating a many-to-many filter relationship with Functions for the Persons entity, the Related Field corresponds to vwPersonFunctions.PersonID, which is the Persons entity's link in the Join Table.
    • The Join Table should be a view in the Database Objects service. You may need to create this table that defines the relationship between the entities if one does not already exist. 
  6. Enter the name of the field within the Join Table that links the Join Table to the entity specified as the Related Entity into the Join Field field (for example, FunctionID).
  7. Enter a description. This description displays in the list of related entities when setting up a filtered view or search for the base entity.
  8. Click OK to close the Relationships form, then save the Entities record.

Unlike in one-to-many relationships, many-to-many relationships do not share a direct link between the tables and require a join table to provide that link. For this reason, many-to-many relationships are also known as indirect relationships. 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.