Create custom scripts

Administrators can add custom features to their libraries using custom scripts.

Automatically generated table of contents

 

Note:
If you need guidance to configure and implement your custom scripts, the AODocs service team is happy to help you organize a design workshop and find solutions to automate your processes.
Contact your AODocs sales representative or send an email to sales@aodocs.com.


What are custom scripts?

Custom scripts are java code fragments configured in the AODocs administration interface. Custom scripts allow library administrators to configure specific actions in their libraries that are not available out of the box in AODocs.

How are custom scripts triggered?

There are five types of custom script:

  • Viewer Action: These custom scripts are triggered when users select a custom action in the document action bar.
  • Workflow Transition Action: These custom scripts are triggered when a workflow transition is performed, when the document leaves a workflow state or enters a workflow state.
  • Update Action: These custom scripts are triggered when the document is updated.
    Note: Edits on attachments don't trigger the update action.
  • Relation Render Action: These custom scripts are triggered when users load the relation section of a document page. They can hide or display related documents.
  • Relation Filter: These custom scripts prevent users from adding specific documents as related items. They filter the list of documents that can be added as related documents.

After creating a custom script, in the library administration you must configure how it will be triggered by users. Below is a summary of where you need to configure how each type of custom script is triggered.

Type of custom script Where to configure how it's triggered Example use case
Update Action Document class page Add prefixes to the names of attachments
Viewer Action Document class page  
Workflow Transition Action Workflow state Record who performed a workflow transition in a Person property
Relation Filter Relations page Filter which documents can be added as related items 
Relation Render Action Relations page Filter displayed related documents and customize display name

 

image01.png

image02.png


Create a custom script

To create a new custom script:

1. Access the library administration and select Custom scripts.

2. Click Add new value and name your script.

3. Select the custom script type:

  • Viewer Action
  • Workflow Transition Action
  • Update Action
  • Relation Filter
  • Relation Render Action

image03.png

Tip: Click the edit button to rename your script.

Note: You can't change the type of an existing script.

4. Click the name of your custom script to configure it.

Learn more: Configure custom scripts.

Was this article helpful? 5 out of 6 found this helpful
If you didn’t find what you were looking for, don’t hesitate to leave a comment!
Have more questions? Submit a request

Comments

5 comments
  • Hello,
    I cannot see the customizations tab in my document class.I only have three tabs Properties, Security, advanced

    0
    Comment actions Permalink
  • To add a custom script to a class (update action or viewer action), you have add it in the "Advanced tab".

    0
    Comment actions Permalink
  • Is there a way to trigger a javascript. When opening an Item within a library, I need to execute an script that reads / gets a query string parameter, but from event for custom scripts, I don't see any like on load or when open. Is that possible to execute it when opening an Item?

    0
    Comment actions Permalink
  • Currently, our custom scripts only support java. Additionally, I confirm that there is no trigger for custom script execution at the document opening.
    The existing triggers are:
    - document update
    - workflow transition
    - custom button on the document
    - relations loading in a document (for filtering)
    Feel free to post a feature request here: https://support.aodocs.com/hc/en-us/community/topics/200132124-AODocs-Feature-Requests
    Following our guidelines: https://support.aodocs.com/hc/en-us/community/posts/360051089432-How-to-Post-a-Feature-Request-on-the-Community

    0
    Comment actions Permalink
  • Is there any Java documentation to can to create these scripts? This to know the objects, methods and functions. Thanks in advance.

    3
    Comment actions Permalink

Please sign in to leave a comment.