Skip to content Skip to footer

JavaScript functions

Users with JavaScript knowledge can create custom function to update the fields value.
The functions are created in the admin area and invoked by name in the JavaScript (advanced) field.
For example: calling the function getCallNumber():

  • Enter only the function body. The function deceleration along with the opening and closing brackets will be added automatically.
  • The function name must start with “get” and should be a valid JavaScript function name (no spaces, no special characters)
    • Input includes 2 parameters:
    • str – the initial value according to the field source (e.g. call number)
    • param – the string that is populated in the JavaScript field
  • The function should return a string


DescriptionFunction body
Display the first 4 characters in the author name in uppercasestr = str.substring(0,4); return str.toUpperCase();
Access other field’s values in the label in addition to the exiting one which invoked the functionconst alt = fieldObj.getParentLabel()
.getField(‘alternative_call_number’); const cn = fieldObj.getParentLabel()

There are no comments yet

Leave a comment

Your email address will not be published. Required fields are marked *