Function #40: Notify users when invoices exceed the credit limit

Function #40: Notify users when invoices exceed the credit limit



Hello everyone, and welcome back to our series!

Businesses tend to offer goods or services on credit to customers, which can, in overtime, lead to the accumulation of significant overdue balances. To address this, Zoho Books allows you to define a Credit Limit for each customer, thereby enabling you to manage credit risks effectively.

In Zoho Books, you can establish credit limits for both invoices and sales orders. If a customer's credit limit is exceeded, you have two choices: prevent the user from creating the transaction or permit them to continue with a warning about the credit limit. Choosing the latter option allows users to complete the transaction despite exceeding the credit limit. If you want to be notified whenever such transactions are created by your users, you can use today's custom function. Please note that this function specifically monitors the credit limit for invoices. Therefore, whenever an invoice is created that exceeds the credit limit, the system will automatically send an email notification to specified users, alerting them about the action. 

Prerequisites: 

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



2. Create a Check Box-type custom field called "Notify about Credit Limit?" for the users. The email notifications about the credit limit will be sent only to those users for whom the checkbox is ticked.



Custom Function:

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

Note: This custom function will run and trigger email notifications when an invoice is saved as draft. 

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.



Voilà! Now, every time a user generates an invoice that exceeds the credit limit, you will be notified immediately. This way, you can have better control over the outstanding receivables and take prompt action to manage any payment delays. 

Try out this function and share your feedback in the comments section. If you need any further customizations, feel free to reach out to us at support[at]zohobooks[dot]com.

See you next week with another useful custom function! 

Regards,
Shireen Farhana
Zoho Books