Function #26: Automatically update deal stage in Zoho CRM when invoice is paid in Zoho Books

Function #26: Automatically update deal stage in Zoho CRM when invoice is paid in Zoho Books


Hello everyone! It's Friday, and you know what that means – it's time for a Custom Function! Let's jump right in.

The Deals section in Zoho CRM, is a valuable tool for tracking the different stages of a business opportunity, starting from its initial qualification to the point where it is finalized and successfully closed. Typically, a deal is considered closed when payment is received, indicating a successful business transaction. 

With the Zoho Books-Zoho CRM integration in place, you can link deals to invoices. These invoices can be raised from both within Zoho Books and the Zoho Finance module in Zoho CRM.  When you receive online payments or record manual payments for these invoices, you need not have to go through the manual process of changing the deal's stage to "Closed Won". Today's custom function takes care of this for you by automatically updating the deal's stage to "Closed Won" in Zoho CRM when invoices are paid.

Prerequisites: 

1. Create a Connection named "crm_connection" to successfully execute the function. You can watch the GIF attached below to know how to create the connection.



2. Create a Connection named "zbooks" to successfully execute the function. You can watch the GIF attached below to know how to create the connection.



Custom Function:

Navigate to Settings -> Automation -> Custom Functions -> +New Custom Function > Add the function code from this GitHub link.

Workflow Rule: 
 
Go to Settings -> Automation -> Workflow Rules -> +New Workflow Rule and set up the workflow rule as shown below:-




In the final step of this workflow rule, associate the custom function you created and then hit Save.

Note: To update the deal's stage to something other than "Closed Won," just replace the stage name in code line 26 with the preferred stage.

Give it a try and share your feedback with us! If you have any questions, don't hesitate to reach out to our support team at support[at]zohobooks[dot]com.

See you all next week with another interesting custom function!

Regards,
Shireen Farhana S
Zoho Cares