Zoho CRM and Zoho Books Integration - Limitations can always be overcome!

We have created a pretty fancy pricing/proposal tool in Zoho Creator for one of our clients that gives them the ability to quickly price out a job based on their specific pricing inputs and then bundle up these prices into packages for their clients to choose from.

Once their client chooses a package and accepts the proposal, our automations fire to spin up the invoice in Zoho Books.

However!

Disaster struck when we realised that the native integration between Zoho CRM and Zoho Books only syncs contacts every 2 hours! 🤦‍♂️🤦‍♂️🤦‍♂️

This means that if a new Lead comes through into CRM from a website enquiry and they generate the pricing within 2 hours, Zoho Books won’t have any record of that contact in its list of Customers and so can’t generate the invoice!

It’s 2024! So I expect integrations to sync data live / on demand. Not in a periodic batch processing schedule.

Well as always, code comes to the rescue.

In a Deluge custom function in Zoho Flow, we wrote some code that lets us query Books to see if it already knows about a Contact based on its CRM Contact ID. If it does, then great, proceed as normal! If it doesn’t, then we can start to build up a Map of all the data we need to feed it to push Books to create this client record right now:

The start of the code looks as follows:

// search for CRM contact id in Zoho Books
booksMap = Map();
booksMap.put("zcrm_contact_id",CRMContactId);
booksCustomer = zoho.books.getRecords("Contacts",orgID,booksMap,"zoho_books");
if(booksCustomer.get("contacts").isEmpty())
{
	info "no customer exists yet!";
   // start to map the required customer data here.
   // code continues…. 
}


Then finally once we have all the necessary data ready to generate a customer record, we push it over to Books:

newRec = zoho.books.createRecord("Contacts",orgID,contactMap,"zoho_books");


As part of this client creation process, we make sure that Books gets its “zcrm_contact_id” field updated with the CRM Contact record ID so that it is linked to CRM and can then be successfully synced every 2 hours just as all the others would by the standard integration going forward.

A lot of applications these days have “1-click” integrations but these are often left lacking once you get into the nuance.

Never fear, code can fix everything 🙂