Library administrators can configure custom actions to trigger a specific custom script on document classes. You can trigger either Update Action or Viewer Action custom scripts on a document class. Learn more: Create custom script.
1. Access the library administration and select Document classes.
2. Press a document class name to open the document class configuration.
3. Select the Customization tab to configure a new custom action.
4. Press Add new action.
Note: You can configure multiple custom actions for one document class.
5. 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: Choose when to trigger the custom script:
- action run when the document is updated
- action called by a user from the Document Viewer page
- Script name: Select the custom script you want to trigger from the drop-down list.
- If the event selected is action run when the document is updated, you can select Update Action custom scripts only.
- If the event selected is action called by a user from the Document Viewer page, you can select Viewer Action custom scripts only.
Learn more: Create custom scripts.
6. Check the Parameters table.
Tip: As a custom script can be triggered on several document classes, 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.