Aras Fundamentals: Customizing Relationships with the RelationshipType

Aras Fundamentals: Customizing Relationships with the RelationshipType

When a Relationship is defined on an ItemType, two new Items are created: a Relationship ItemType and a RelationshipType.  In a previous blog post, we went over how to create a new Relationship for an ItemType and some basic aspects of configuring the Relationship, most of which took place on the Relationship ItemType.  This Aras Fundamentals blog will expand our ability to customize a Relationship by adjusting settings on the RelationshipType Item.  We’ll be working with the Purchase Order ItemType from previous Fundamentals posts, too.

First, we’ll set a minimum number of Part relationships required for a new Purchase Order to be saved.  Then we’ll discuss how to hide the Relationship Tab in the Item Editor, and why we’d want to do that.  Finally, we’ll customize what a Relationship Tab displays based on who is using the Relationship View.

Minimum and Maximum Occurrences

Let’s open up the Purchase Order Part RelationshipType for editing (not the ItemType!), which can be found under Administration > RelationshipTypes > Search RelationshipTypes.  When a new Purchase Order is created, we want at least one Part to be attached to it before it can be saved.  To ensure that this happens, we’ll set the Minimum Occurrences (in the Related group box) to 1.  Now, save and unlock the Item and we’re done! We can test this out by creating a new Purchase Order and trying to save the Item without adding a related Part; an error dialog will be shown to us indicating what the problem is.

This method also works if we want to set a maximum number of entries of a RelationshipType, just enter the maximum value in the Max Occurs field.  Both occurrence checks can be used simultaneously, just be sure that the minimum is less than the maximum.  Additionally, if we wanted to remove any occurrence checks, we would leave the field blank (rather than enter in a value of 0).

 

Hiding the Relationship Tab

Next, let’s go over the “Hide in All” option for the RelationshipType (In the Source group).  Checking this option will hide the tab for this ItemType on the Relationship Grid of the parent Item.  This is useful for any Relationships that are set and used behind the scenes, but that end users don't need to see.

 

Customizing the Relationship View

Sometimes, when we have a Relationship, the standard grid layout isn’t the best way to show the information for that Relationship.  Or possibly we want to have different Views depending on what User is looking at the parent Item.  Building a custom view from the ground up is beyond the scope of this blog, so we’ll use two existing RelationshipTypes as examples: Project Tree on the Project ItemType and Part Multilevel BOM on the Part ItemType.  Let’s take a look at the Project Tree RelationshipType first.

The Project Tree’s Relationship View is set for the World Identity, so all users will see the Relationship View.  The Start Page value is set to an HTML file so when the Project Plan Tab is opened, a custom HTML page is loaded instead of the standard relationship grid, as shown below. 

 

The Relationship View for Part Multilevel BOM has the Start Page pointing to the Tree Grid View main page.  In order for this page to display the Part Item’s data correctly, we also need to pass in Parameters such as the ID of the Tree Grid View and a start condition with the source ID of the Part Item.  When we open the BOM Structure Tab on a Part that’s an Assembly, we can see the entire bill of materials in an expandable list.

 

Conclusions and Congratulations

Today, we dug deeper into the ways we can customize our Relationships in Aras Innovator, with a focus on the RelationshipType.  We started simple, with setting minimum and maximum limits on the number of related Items.  Then we discussed hiding a Relationship Tab, and when it would be useful to do so.  Finally, we showed two examples of changing what’s shown in the Relationship Tab using the Relationship View.  Thanks for reading this Aras Fundamentals blog!  There are more in the series that help explain different concepts and ItemTypes within Aras Innovator.  Or visit the Forums to ask and find answers to specific questions.