Trigger custom scripts on relations

As a library administrator, you can configure custom actions to trigger a specific custom script on a relation. You can trigger Relation Filter or Relation Render Action custom scripts on a relation. Learn more: Create custom scripts.

 Access the relations configuration
 Trigger a Relation Filter custom script
Trigger a Relation Render Action custom script


Access the relations configuration

1. Open the library administration interface and select Relations.

2. Press a relation name to open the relation configuration.

image_01.png


Trigger a Relation Filter custom script

1. Press Create a From Filter action or a Create a To Filter action to trigger a Relation Filter custom script. 

Note:
- The side of the relation is important when configuring a custom filter action.
For example, let's say you have configured your relation Supplier - Invoices so that the document class Supplier is on the From side and the document class Invoice is on the To side. If you create a From Filter action, the custom script will filter the Suppliers you are allowed to add as a related item from an Invoice.
- You can trigger only one Relation Filter custom script for each side of the relation.

image_01.png

2. Fill in the settings of the newly created custom action:

  • Action name: This value can be retrieved in your custom script by calling the method _getDisplayName. 
    Note: This name will be displayed in the custom action menu displayed to end-users if a Viewer Action is configured.
  • Event: select ON_FILTER
  • Script name: Select the custom script you want to trigger from the drop-down list. 
    Note: You can select only Relation Filter custom scripts. Learn more: Create custom scripts.

image_02.png

3. Check the Parameters table.

Tip: As a custom script can be triggered on several workflow states, the custom script code can call specific parameters from the Parameters table. When configuring a custom script action, you can modify the second column Values of the Parameters table to adapt the custom script for the action you are configuring. 


Trigger a Relation Render Action custom script

1. Press Create a Render action to trigger a Relation Render Action custom script. 

Note: You can configure multiple custom actions for one document class.

image_03.png

2. Fill in the settings of the newly created custom action:

  • Action name: This value can be retrieved in your custom script by calling the method _getDisplayName. 

Note: This name will be displayed in the custom action menu displayed to end-users if a Viewer Action is configured.

  • Event: select ON_RENDER
  • Script name: Select the custom script you want to trigger from the drop-down list. 
    Note:
    - You can select only Relation Render Action custom scripts. Learn more: Create custom scripts.
    - The custom action configured doesn't depend on one side of the relation.

image_04.png

3. Check the Parameters table.

Tip: As a custom script can be triggered on several workflow states, the custom script code can call specific parameters from the Parameters table. When configuring a custom script action, you can modify the second column Values of the Parameters table to adapt the custom script for the action you are configuring. 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.