Function 33#: Associate invoice templates automatically based on customer address

Function 33#: Associate invoice templates automatically based on customer address



When a business deals with customers across various countries, there may arise a need to have different templates applied which caters to the customer's country specific billing requirements.

While we do allow users to associate the required templates to the customers manually, it could get tedious over time as your business expands.

For this scenario, you can build all the invoice templates with each country’s specification and name each template after the corresponding country.

Today’s custom function will then help you automate the
appropriate invoice template selection at customer level based on the primary billing country of the customer. 

Here's how the custom function will work:
 
Once you create a customer profile with a billing address and save the customer, this custom function will be executed. The function will check for the billing country chosen in the customer's address and automatically associate the corresponding template to the customer.

You can then cross-check the template applied by heading over to Sales >> Customers >> Click on the customer profile  >> More >> Associate templates. The template that is automatically selected for 'Invoices' there will be applied for the future invoices of that particular customer by default.

Pre-requisites:

1. Create a Connection named "zbooks" to successfully execute the function. You can watch the GIF attached at the bottom of this post to learn how to create the connection.

2. Create invoice templates for each billing country and label each template according to its respective country.


Lets say, you're designing a template for a customer based out of Singapore, the template in this case should be named "Singapore".

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.

The script shared works for the Invoice template selection based on customer address and we hope this automation takes you one step further in fine-tuning your business workflow.

Should you need assistance in configuring a similar workflow for any other module, do reach our support desk. We will be available to help you.

Regards,
Archana Puthumana
Zoho Cares


    Access your files securely from anywhere

        All-in-one knowledge management and training platform for your employees and customers.







                              Zoho Developer Community




                                                    • Desk Community Learning Series


                                                    • Digest


                                                    • Functions


                                                    • Meetups


                                                    • Kbase


                                                    • Resources


                                                    • Glossary


                                                    • Desk Marketplace


                                                    • MVP Corner


                                                    • Word of the Day


                                                    • Ask the Experts





                                                              Manage your brands on social media



                                                                    Zoho TeamInbox Resources



                                                                        Zoho CRM Plus Resources

                                                                          Zoho Books Resources


                                                                            Zoho Subscriptions Resources

                                                                              Zoho Projects Resources


                                                                                Zoho Sprints Resources


                                                                                  Qntrl Resources


                                                                                    Zoho Creator Resources



                                                                                        Zoho CRM Resources

                                                                                        • CRM Community Learning Series

                                                                                          CRM Community Learning Series


                                                                                        • Kaizen

                                                                                          Kaizen

                                                                                        • Functions

                                                                                          Functions

                                                                                        • Meetups

                                                                                          Meetups

                                                                                        • Kbase

                                                                                          Kbase

                                                                                        • Resources

                                                                                          Resources

                                                                                        • Digest

                                                                                          Digest

                                                                                        • CRM Marketplace

                                                                                          CRM Marketplace

                                                                                        • MVP Corner

                                                                                          MVP Corner









                                                                                            Design. Discuss. Deliver.

                                                                                            Create visually engaging stories with Zoho Show.

                                                                                            Get Started Now


                                                                                              Zoho Show Resources

                                                                                                Zoho Writer

                                                                                                Get Started. Write Away!

                                                                                                Writer is a powerful online word processor, designed for collaborative work.

                                                                                                  Zoho CRM コンテンツ




                                                                                                    Nederlandse Hulpbronnen


                                                                                                        ご検討中の方