This article explains how super administrators and Script Administrators create shared custom scripts in the AODocs tenant administration, and manage their versions.
To learn how shared scripts work, read What are shared custom scripts?.
Automatically generated table of contents
Open the shared scripts
1. Open the AODocs tenant administration.
2. In the left panel, under Configuration, select Custom scripts.
The Custom scripts page has two tabs:
- Scripts: the list of shared scripts, with each script's name, type, latest version and last modification date. You can filter the list by Script type. For each script, you can see whether a draft is open, its latest promoted version, and how many versions it has.
- Deployment history: every deployment of a version to several libraries. Learn more: Deploy a shared custom script version to several libraries
Note: Library administrators see the same scripts, read-only, in the Shared scripts tab of the Custom scripts page of their library administration. Learn more: Use a shared custom script in your library
Create a shared script
1. On the Scripts tab, click Create shared script.
2. Enter the Script name.
3. Select the Script type: Relation filter, Relation render, Update action, Viewer action, Workflow transition or Reminder condition. Learn more: What are shared custom scripts?
4. Click Create.
The script is created with an empty draft version, and it's immediately available in every library on your domain. There is no separate step to publish it.
Important: The script type can't be changed after the script is created.
Write and promote a version
Edit the draft
While a script has an open draft, you can edit its code, parameters, imports, execution settings and description.
1. In the list of scripts, click the script name. The script editor opens on its draft.
2. Write the code in the code editor, and use the Method drop-down list to switch between methods.
3. In the right panel, use the General, Parameters and Documentation tabs to set the description, the parameters and the settings:
– Run script with administrator privileges: by default, the script runs with the privileges of the user who triggers it.
– Run script asynchronously: the script starts a few seconds after it's triggered. Recommended for long or heavy scripts.
4. Click Save.
The General tab also shows the script type, the version, and when and by whom the version was last updated.
These settings work like the settings of local scripts. Learn more: Configure custom scripts
Important: Libraries that use the draft get your changes as soon as you save them. Test drafts only in libraries that don't need stable behavior.
Promote the draft
When the draft is ready, promote it to a permanent, named version.
1. In the script editor, click Promote.
2. Enter a Version name. It must be unique within the script.
3. Enter a Version description.
4. Click Promote.
The version is now frozen: its name, code and configuration can't change anymore. Only its description can still be edited. The script has no open draft until you create a new one.
Tip: After promoting a version, deploy it to the libraries that use the script from the script's Deployments page. Learn more: Deploy a shared custom script version to several libraries
Create a new draft from a promoted version
To change a script that has no open draft, create a new draft from one of its promoted versions. The draft starts as a copy of that version.
1. Open the script on the promoted version you want to start from.
2. Click Create version. A new draft is created with a copy of that version's code and configuration.
Note: You can only create a draft when the script has no open draft. If a draft is already open, promote it or delete it first.
Delete a draft
You can delete a draft you don't need anymore, if the script has at least one other version. A script always keeps at least one version.
Important: Deleting a draft also removes it from every trigger that uses it, in every library. Those triggers no longer run the script.
Note: You can't delete a draft if it's the only version of the script. In that case, delete the whole script instead.
Rename a shared script
A super administrator or Script Administrator can change the name of a script at any time. The name is the only thing you can change on the script itself; its type can't change, and everything else – code, parameters, imports, settings and description – is stored in its versions.
Renaming doesn't change the versions or the triggers that use them in libraries.
Delete a shared script
Important: Deleting a shared script is irreversible. The script stops running immediately in every library that uses any of its versions, draft or promoted.
Before you delete a script, check which libraries use it on its Deployments page: the confirmation message doesn't list the affected libraries.
1. On the Scripts tab, click the delete icon on the script's row.
2. Confirm.
AODocs then:
- removes the script from every trigger, in every library, that uses one of its versions – nothing is kept in the libraries
- deletes all the versions of the script, then the script itself
The deletion runs in the background and can take some time when many libraries use the script. If it fails, the script is kept and you can start the deletion again. You can't delete a script while one of its deployments or rollbacks is running.
Audit log
Actions on shared scripts are recorded in the AODocs tenant audit log, with the user and the date: script created, renamed and deleted; draft created, updated and deleted; version promoted (with its name); deployment and rollback. Their event names start with DOMAIN_CUSTOM_SCRIPT_, so you can tell them apart from the events of local scripts.
Learn more: View and export the AODocs tenant audit log and Audit log messages