Check Presence of Relation action is intended to control whether or not a link is created between a given item and another selected item in the eWay-CRM system. For example, whether or not the Handover protocol of a project type is attached, when the project continues to the Invoicing status.
|Enter the relation type.
|Related Table Name
|Enter the table name in the database you wish to check.
|Intended for entering the text to be displayed when the desired relation doesn't exist.
|Fields to Check
Allows to check attributes (field value) of a related item.
A new relation to be checked can be added to the Fields to Check table via the Add button. The table contains two columns:
System variables can be used in fields during actions creating. For more information, go to System Variables Available in Actions.
Depending on the Completion Level adjustment from the last step, condition completion will be mandatory (Cannot Ignore for selected user groups) and until the condition is completed, the transition will not be available for user. In the case of the less strict control variant (Can Ignore) the notification will be displayed to the user that the expected and real values are not identical and whether he wishes to continue to the next workflow status or not.
If you wish to save the currently defined action for future use in another workflow type, you can do it via the button Template->Export. If you have already defined and exported an action of the Check Presence of Relation type from earlier workflow editing, you can reuse it via 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.
Example – Check If the Offer Is Attached to the Project
The relation type that we wish to check. You can remain it blank for most cases. If you want to search specific relation between item and its superior item, type in SUPERIORITEM.
Related Table Name
Table name in the database, to which the relation of given type should exist. It will be the Documents table in our case.
|Text that will be displayed to the user when the relation doesn't exist, e. g. The offer is not attached.
Fields to Check
Field that will be checked. We want to check whether the attached document type corresponds with value contract. So by clicking on Add button we need to insert DocTypeEn value.
The value to be checked with the Fields to Check of the related object. We will use an SQL request that returns the identification of the Offer value in the drop down menus table. We fill in:
SQL#SELECT EnumValues.ItemID FROM EnumValues INNER JOIN EnumTypes ON EnumValues.EnumType = EnumTypes.ItemID WHERE EnumTypes.EnumName = 'DocumentType' AND EnumValues.en = 'Offer'