Integrating with Zoho Books allows you to easily access your contacts' financial information, including invoices, estimates, purchase orders, and sales orders, within your CRM. This helps you track and manage key CRM and accounting information in one place. However, there may be times when you need to access the contact's additional information or perform a financial task in Zoho Books. A direct link to the contact in Zoho Books is quite helpful. We've got you covered.
The custom function shared in this solution retrieves the URL of the corresponding contact record in Zoho Books and updates it in a custom contact field in your CRM. Simply add a custom URL field, write the function, and link it with a workflow rule that triggers the function on creating or editing a contact record.
Permissions and availability
- Users with the Manage Extensibility permission can create connections and write custom functions.
- Users with the Modules Customization permission can add custom fields.
- Users with the Manage Automation permission can create and update workflow rules.
- Users with the Manage Sandbox permission can manage the sandbox.
Requirements
- Configure the Zoho Finance Suite integration and activate the Zoho Books finance modules in your CRM. Learn more
- Create a Zoho Books connection with the required scopes for your Zoho CRM account, as detailed in the "Create Connection" section below. Learn more
- Add a URL field in the Contacts module. This field will hold the corresponding contact's URL retrieved from Zoho Books. Learn more
- Create a workflow rule for the Contacts module that triggers every time a contact is created or edited. Learn more
- Write a custom Deluge function and link it up with the workflow rule. Learn more
- Test the workflow rule in a sandbox before deploying it to your production environment. Learn more
Create a connection
The first step is creating an OAuth connection in your Zoho CRM account.
- Go to Setup > Developer Space > Connections.
- Click Create Connection.
- Select Zoho Books under Default Services.
- Specify a Connection Name.
You must enter this name in the code snippet below. - Select the following Scope to request access.
- ZohoBooks.fullaccess.all Learn more
- Click Create and Connect.
- Click Connect and then click Accept to confirm authorization of access for the scopes requested by the client.
Add a custom field
The next step is adding the custom URL field to the Contacts module.
- Navigate to Setup > Customization > Modules and Fields.
- Click the Contacts module to open the layout editor.
- Drag and drop the URL field from the New Fields tray to the desired section of the layout.
- Name the URL field (e.g. "Zoho Books Contact URL") and define its properties as required.
- Once you have finished, click Save and Close.
Create a workflow rule
Follow the steps below to create a workflow rule in your Zoho CRM account:
- Navigate to Setup > Workflow Rules > +Create Rule.
- Select Contacts from the module dropdown list.
- Provide a name for the rule. For example: "Update Zoho Books Contact URL".
- Add a description (optional), then click Next.
- In the Execute this workflow rule based on section, do the following:
- Choose Record Action, then select Create or Edit from the dropdown.
- Check the box for Repeat this workflow whenever a Contact is edited.
- Click Next.
- In the Which contacts would you like to apply the rule to? section, specify the condition as "<Zoho Books Contact URL> <is empty>" and click Next.
- Under Instant Actions, select Function and Write your own.
- Provide a name and description, if necessary, for the function.
- On the Deluge Script Editor, do the following:
- Copy and paste the code given below.
- Click Edit Arguments.
- Choose Contacts - Contact Id, name it contId, then click Save.
- Click Save & Execute Script.
- Click Save on the workflow rule page.
The code
orgID = "123456789";
customer = zoho.books.getRecords("Contacts",orgID,"zcrm_contact_id=" + contId,"connectionname");
info "customer : " + customer;
customerid = customer.get("contacts").get(0).get("contact_id");
info "customer ID : " + customerid;
val = "https://books.zoho.com/app#/contacts/";
url = val + customerid;
mp = Map();
mp.put("Zoho_Books_Contact_URL",url);
info mp;
update = zoho.crm.updateRecord("Contacts",contId,mp);
info update;
Notes
- Replace "123456789" with the Organization ID of your Zoho Books account. Learn more
- Replace "connectionname" with the name of the Zoho Books connection.
- Use the accurate API name of the custom URL field in the code snippet (e.g., "Zoho Books Contact URL"). Learn more
- The code above is an example to retrieve a contact's URL from your Zoho Books account. You can use this code for any other module, such as accounts, by modifying the module name and parameters.
Tip
- Configure and test the function in a sandbox to ensure that further development doesn't disrupt your production environment.
Test the solution
- Navigate to the Contacts module.
- Open a contact record to view its details.
- On the Contact Details page, edit a field and click Save.
Note: Add a new contact to ensure it functions correctly.
The workflow rule will be triggered. - Check whether the custom URL field gets updated with the contact's corresponding URL from Zoho Books.
Did you find this useful? Try it out and let us know how it works. Share this with your team if they'd benefit from it! If you have questions, please don't hesitate to contact us.
More info
- ModuleContacts
- Trigger PointWorkflow Rule
- EditionEnterprise and above
- ComplexityHigh
- Implementation Time60 minutes

Looking for a custom solution?
Contact us, we will help enhance your productivity at lightning speed.
SUBMIT REQUEST