Configuring a Group Relation Template

In the Company 1 Example, the Relation between Company 1 Sales Order Header and Company 1 Sales Order Detail is an example of a Group Relation. When the user Clones the Company 1 Sources to make Company 2, they will want a new Relation to be created between the Company 2 Sales Order Header and the Company 2 Sales Order Detail Sources. See below for a visual example.
 
Desired Group Relation behavior when Cloning
 

Converting Existing Relations into Templates

In this example, we will be creating a Relation Template from scratch.  If you need to convert an existing Relation to a Relation Template, open the Relation and uncheck the Primary Flag if it is checked.  Afterward, select the Convert to Template button. This creates a relation matching the exact Relation existing and applies the Template to the Relation.

The Relation Template - Group Relation Style

Let's start by opening the Relation Template page from the main menu (menu -> Templates -> Relation Templates).  To create a Relation Template between two Source Templates, the Relation Template needs to be created from the Relation Template page rather than converting an existing relation.  
 
 
Start creating a new template by clicking the NEW + button.  Providing a relation name and choosing a Test Source (choose the source you want to apply the template to first) opens the additional Relation settings.
On the Template, there is one button that controls whether this Relation will be treated as a Master Data Relation or a Group Relation when Cloning, the "Related Source Type" toggle. For a Group Relation Relation, we want this toggle to be set to "Source Template". This tells DataForge that any source using this Template should be related to the Source within its Group that uses the Source Templated listed in the Related Source Template box. For example, Company 1 Sales Order Header will want to relate to Company 1 Sales Order Detail, while Company 2 Sales Order Header will want to relate to Company 2 Sales Order Header. When choosing the Related Source, the list of source templates will show rather than a specific source (e.g. ${GROUP} - SalesOrderHeader).
 
 
Once the Relation Expression has been entered, use the Test button to validate the Relation Template. If the Relation Template is not valid, an error will be returned that the user can fix and then retest. 
 
 
After the Test is successful, the Save button will become clickable. Save the Relation.
 
 
Now the Relation Template is valid and can be applied to Sources.  Open the Linked Sources tab to apply this Template.
 
 
Select the NEW + option and choose the Sources the Relation Template should be applied to.
 
 
Select the Validate option to validate the Relation Template on the Source and apply the Template. After validating, the relation template will be applied to the Source and appear on the Source's Relation list.
 
With this Relation Template created using the "Source Template" toggle, we have successfully made a Relation that will follow the Group Relation style when cloned! In the next section, we will perform the Clone operation and observe the resulting behavior.

Updated

Was this article helpful?

0 out of 0 found this helpful