Create Relation – Action Description

Create Relation action offers an opportunity to create a relation from the item you edit to another item in the system. This action can also create a copy of the source item instead of creating relation every time with the same item. For example it can be used in a project workflow within transition from the Offer status to the Contract status, where system adds a copy of a contract template and then you can edit the document according to your needs.

Module Field allows you to select the module type you want to create a relation with. For example, if you want to create a relation from project with a contract, you need to choose the Documents module.
Name

Text field where you insert the name of the item. It must be an already existing item of the module and you fill in the whole name of it, in case of documents include the suffix. To make sure that you are entering a right name, you can always check the window title (see the picture below).

It can also be defined using SQL expression.

Attention
The query has to always return a column named FileAs.
 
SQL#SELECT FileAs FROM Documents WHERE af_10 = YEAR(GETDATE())
Create Item Copy

You can also mark the Create Item Copy check box to create a relation with the copy of item from field Name, not the original item itself. This behavior can be useful in our case, when we want to add a contract template to our project but we want the original document to stay unchanged even when users fill in details of the particular project to the document.

On the other way, there are times, when making a copy would be counterproductive. For example, when creating a relation to a category. In such a case, leave Create Item Copy check box unmarked.

If you wish to save the currently defined action for future use in a different workflow, you can do it via Template -> Export. If you have already defined actions of the Create Relation type and you have already exported them from earlier workflow editing, you can reuse them via the menu Template -> Import. More information about import and export of workflow actions can be found in the chapter: Import and Export of Workflow Action Definitions.