This article explains how library administrators use a shared custom script in their library, by selecting one of its versions on a trigger.
Shared scripts are created in the AODocs tenant administration by super administrators and Script Administrators. Learn more: What are shared custom scripts?
Automatically generated table of contents
View the shared scripts
1. Open the library administration.
2. Select Custom scripts.
3. Select the Shared scripts tab. The Local scripts tab lists the scripts created in your library.
You can open a shared script to read its code and versions, but you can't edit it. To ask for a change, contact your super administrator or Script Administrator.
Use a shared script on a trigger
You select one exact version of the script, so you always know which code runs in your library. Every version is available as soon as it exists; you don't have to wait for a deployment.
From the script page
1. In the Shared scripts tab, click the script name.
2. In the right panel, select the Trigger tab.
3. Click Add trigger.
4. Enter the Trigger name.
5. Select where the script runs (for example, the Document class for a Viewer Action).
6. In Version to use, select the version.
7. Click Create trigger.
The trigger is listed in the Trigger tab, with the version it uses.
From the document class, workflow or relations configuration
You can also select a shared script where you configure triggers, as for local scripts. Only the scripts that match the trigger type are listed, and each version is labeled with the script name and the version name, so you can tell a promoted version from a draft. Local scripts appear in the same list.
- Trigger custom scripts in document classes
- Trigger custom scripts on workflow states
- Trigger custom scripts on relations
- Step 5b: Configure workflow emails – Action reminders: Reminder Condition scripts are selected on workflow reminders
Important: Don't use a draft version in a library that needs stable behavior: the draft's code can change at any time. Drafts are meant for testing.
When a new version is released
Your triggers keep using the version you selected until:
- you select another version on the trigger, or
- a super administrator or Script Administrator deploys a new promoted version to your library. Learn more: Deploy a shared custom script version to several libraries
Note: A deployment doesn't change triggers that use a draft version. If the draft is deleted, the triggers that use it are cleared and the script no longer runs on them. If the whole script is deleted, it's removed from all your triggers.
The custom script log of your library shows which version of a script ran, and you can filter it to show only shared scripts.