Custom Functions

Custom Functions in Zoho Expense allows you to simply drag and drop code to automate your business processes. Using custom functions, you can update the data in a related database or a third-party application automatically by executing simple program scripts, which are written using the low-code programming language, Deluge.

Using Custom Functions in Zoho Expense, you can program scripts using Deluge Script, associate them to workflow rules, and automate the process based on your organisation’s needs.

For example, let’s say your organisation uses a fleet of vehicles to help your employees to commute from home to office and back. The head of transportation in your organisation wants to implement a new system wherein the employees are prevented from creating mileage expenses in Zoho Expense for the expired vehicles. This new system will help save a lot of time as approvers spend a lot of time rejecting the mileage expense reports for expired vehicles. Using the custom functions in Zoho Expense, you can simply use the deluge scripting language and associate them to workflow rules to simply prevent employees from creating mileage expenses for expired vehicles.

Similarly, you can create such custom functions and automate such unique processes based on your organisational needs.


Create Custom Function

  1. Click Admin View.
  2. Go to Settings on the left sidebar.
    (OR)
    Click the Gear icon at the top right side.
  3. Click Actions under Automation.
  4. Switch to the Custom Functions tab.
  5. Click + New Custom Function in the top right corner.
    Create Custom Functions
  6. Enter the name and description for your custom function.
  7. Select the module for which you want to trigger the custom function. You can create custom functions for expense reports, employee advances, trips, users, and employees’ advance refunds.
  8. Write the function in the deluge script editor.
  9. Click Save.
    Create Custom Functions

Insight: Deluge or Data Enriched Language for the Universal Grid Environment is an online scripting language that lets you program your own functions and add different types of business logic as required.

Pro Tip: You can quickly access the support and guide related to Deluge in the top right corner of deluge script editor.


Associate Custom Function to a Workflow Rule

The custom function that you create should be associated with a workflow rule. Whenever a record matches the criteria in a workflow rule and the workflow rule is triggered, the associated custom function will also be executed automatically.

  1. Click Admin View.
  2. Go to Settings on the left sidebar.
    (OR)
    Click the Gear icon at the top right side.
  3. Click Workflow Rules under Automation.
  4. Click + New Workflow Rule in the top right corner. Create Custom Functions
  5. Enter a Name and Description for your workflow.
  6. Select a Module for which you want to trigger the workflow.
  7. Choose the Workflow Type and when you want to trigger the workflow.
  8. Besides the Event and Date-based triggers, you can optimize the triggers by setting additional filters under Filter the triggers.
  9. Under Actions, choose the Type as Custom Functions and select the custom function you want to associate with the workflow rule.
  10. Click Save.
    Associate Custom Functions

Edit Custom Function

To make changes to the custom functions you have created:

  1. Click Admin View.
  2. Go to Settings on the left sidebar.
    (OR)
    Click the Gear icon at the top right side.
  3. Click Actions under Automation.
  4. Switch to the Custom Functions tab.
  5. Hover over the custom function you want to edit and click the More icon next to the custom function.
  6. Click Edit and make the necessary changes.
  7. Click Save.
    Edit Custom Functions

Delete Custom Function

You can delete a custom function permanently. Once you’ve deleted a custom function, the custom function related to a workflow rule will no longer be executed.

To delete:

  1. Click Admin View.
  2. Go to Settings on the left sidebar.
    (OR)
    Click the Gear icon at the top right side.
  3. Click Actions under Automation.
  4. Switch to the Custom Functions tab.
  5. Hover over the custom function you want to delete and click the More icon next to the custom function.
  6. Click Delete.
    Delete Custom Functions
Get a personalized demo from our experts

By clicking Submit, you agree to our Privacy Policy.