Custom Functions Using Zoho Finance CLI

In Zoho Books, the primary method to write a custom function’s code is using the built-in Deluge editor. With the Zoho Finance CLI, you can write the code for custom functions in popular programming languages such as Java, Node.js, and Python. Once you write the code, you can easily push it to Zoho Books.

Insight: A Command-Line Interface (CLI) is a text-based User Interface (UI) used to run programs, manage computer files, and interact with the computer. Inputs are provided to the CLI through the command prompt or terminal and are then executed by the computer.

Prerequisite: To use the Zoho Finance CLI, you need to download Node.js. Download Node.js version 16 on your device. This comes with npx installed. Once installed, enter the following commands to verify if they were installed properly.

  • node -v
  • npx -v

Zoho Finance CLI Commmands

Refer to the commands listed below to use the Zoho Finance CLI toolkit.


Log In to Your Zoho Account

You need to login to your Zoho account using the terminal or command prompt. Here’s how:


Download the Custom Function

You need to create a custom function in Zoho Books and download it on your device to enter the required code using CLI. Here’s how:

Here, xxxx… represents the custom function’s ID, and yyyy…. represents your organisation’s ID. Click Copy next to the command on the custom function’s Edit page to use the prefilled custom function ID and organisation ID.


Write the Code in the Editor

You can write the custom function’s code in a code editor. After downloading a custom function, a folder will be downloaded to your current working directory, containing the necessary files for the custom function.

To write the custom function’s code:


Execute the Code

You can execute the custom function’s code to verify if it’s working as intended. Here’s how:

Once the custom function is executed, the result will be displayed.


Push the Code to Zoho Books

Once you’ve written and executed the custom function’s code, you can push it to Zoho Books to update the custom function in the app. Here’s how:

With this, the custom function will be pushed and updated in your Zoho Books organisation.

Note: Custom functions created using the Zoho Finance CLI cannot be edited from Zoho Books. They can only be edited in the terminal or command prompt. However, you can delete these functions directly from Zoho Books if needed.


Log Out of Your Zoho Account

After you’ve pushed the custom function’s code to Zoho Books, you need to log out from your Zoho account. Here’s how:


Was this document helpful?
Yes
No
Thank you for your feedback!
Want a feature?
Suggest
Switch to smart accounting software. Switch to Zoho Books.   Start my free 14-day trial Explore Demo Account

Books

MTD ready accounting
software for small
businesses.