
Deluge Tips – Null Check
When scripting, ask yourself this question – will this value ever be null? If it’s a yes, that’s a place for a null check! Here are 3 tips and best practices to help you kickstart the habit.
Like many of our posts that link back to our GitHub page, here’s a specific use case with limitless customizability.
Think about your sales process as currently laid out in Zoho CRM. Leads come in, they talk to a salesperson, they progress through the pipeline until they are ready to sign a contract or make a purchase.
Now, how nice would it be if you could, at the press of a button, send that client an email w/a Zoho Books invoice? Replete with “Pay Now” buttons that link to PayPal/Stripe/other payment gateways?
If you like this, you’ll probably love our other Zoho training resources (they’re free!).
A quick point to note — this integration works OUTSIDE of the boundaries of the CRM-Books integration. You can still have the CRM-Books integration set up and use this code, but it’s not necessary to have it enabled.
The CRM-Books integration DOES have an automated invoice creation tool, but we’ve seen the following problems with it:
In a word — yes! You’ll just have to change the API calls, connections, and “zoho.books” built-in Deluge connections. Besides that, the code will work perfectly w/Zoho Invoice.
If you haven’t ever created a connection (not to be confused with integration) between Zoho CRM and another Zoho app, watch the below video:
Click this link from our GitHub to see our code.
The code starts similar to most other functions we write. We query the information we want from the Contact record and define the variables we will use later in the function (name, email, etc.).
Next, comes a Zoho-defined API call. Almost all commands in the Zoho Finance Suite require an “Organization ID”, so we use this to query that for later use. We learned this from the Zoho Books API Doc.
Next, a quick search of the Customers module (API name of “contacts”, yes, it’s confusing lol) for customers with the same email as our CRM Contact.
If it finds a Customer with that email, we attach the Invoice to that Customer and pull the Contact Person information for our email.
If our search turns up empty (i.e. there is no Customer record in Books that matches that email) we first create that record before pulling the Contact Person information for the Invoice. This is the “if…else” code from lines 23-56.
Next, we create the map to populate the Invoice. Put in the Contact Person’s information, the invoice line items, and the payment options. More details on the actual Invoice creation is found here.
Quick note: if you created custom fields for your invoice and have trouble adding them to a record (like we did), look at our other Zoho Books Custom Fields repository for help.
To finish up, use the zoho.books.createRecord command to create the Invoice. Then, if created correctly, the last API call (seen below) sends off the email! Note how you need to customize the URL on the second line down with the invoice AND organization ID’s.
Trigger this function using a workflow rule or create a custom button to fire it when you want. Again, here is the link to the code and to the Workflow Academy GitHub page.
100+ lines of code?! What if I can't implement this on my own???
You’re probably not alone in thinking this. And, you have a million other things you specialize in and need to focus on.
If this is the case, click the button below to learn how we can help you. With years of experience fine-tuning our Zoho skills, chances are we can build whatever you require!
And if your need or project is not a good match for our skill set, we can match you with the right person in our extensive Zoho network.
When scripting, ask yourself this question – will this value ever be null? If it’s a yes, that’s a place for a null check! Here are 3 tips and best practices to help you kickstart the habit.
This set up allows you to insert subform rows and add to picklist dynamically with values unique to each row on a Zoho Creator subform.
This script allows you to create a HTML table in Deluge with dynamic rows, then merge the entire table into the Writer template via a Rich Text Field.
When a Zoho CRM record is created/updated/deleted via Deluge, the system does not trigger any associated workflow/assignment rules unless it’s told to. This article demonstrates the different trigger parameters needed to perform these actions.
This tutorial will illustrate how to create a custom function (using Deluge scripting) where when an Invoice is submitted in Zoho Books, an Equipment record is created in Zoho CRM that tracks which specific units a customer owns.
This tutorial demonstrates the integration between Shopify and Zoho Inventory. Use deluge scripting in Zoho Inventory to create Package and Shipment (marked as delivered), the Invoice (marked as sent), and the Payment for the Invoice upon Sales Order Creation.
Responses