Welcome to Zuora Product Documentation

Explore our rich library of product information

Test a function

Learn how to test a function when creating or updating it.

To ensure the return value of a function meets your expectations, it is a good practice to test a function before activating it.

You can test a function during the creation or update.

  1. Click Test when creating or updating a function. The Input and Output fields are displayed. All custom fields of the current object are pre-populated in the Input field with the null value.
    test function
  2. Optional: Edit field names in the Input field. You can also add standard fields if the context object is a standard object.
  3. Specify field values in the Input field for testing. After changes to the Input field are detected, Zuora calls this function with the data in the Input field as input value and displays the return value in the Output field.
    test function failure
    test function success
  4. If the return value is not as you expected, revise the JavaScript code in the Enter Script field and repeat steps 2 and 3.