Functions | Online Help - Zoho CRM

Associate Functions

Zoho CRM Functions help you to update the data in related CRM modules or third-party applications by executing simple program scripts. When a record matches the workflow criteria, workflow engine automatically triggers the function and update the CRM records. With Functions, you can program scripts using Deluge Script (powered by Zoho Creator), associate them to workflow rules, and automate the business process. See Also Deluge Script - Reference Guide.

Business Scenarios

  • Roll up amount from each deal (status is closed won) to Total Revenue (custom field) to the related Account. If customer makes 10 payments, you can view the total revenue from Account page, instead of creating a report. Based on the total revenue generated from customer, you can grade them type A, type B, type C customers.
  • Create a project in Zoho Projects or any 3rd-party project management application when the deal is won and closed in CRM. Also, view the project link under an Account or Deal record to monitor the progress of the project.
  • Automatically update the address information of contacts based on the mailing address of the parent account.
  • When the deal status is "closed won", push the deal, related contact and account details to Zoho Books or any 3rd-party accounting software. Once status of the invoice is changed to "paid" in accounting software, instantly update Deal record in CRM.

Target Audience

  • CRM Administrators who set up workflow rules for Users
  • Programmers with REST API and Deluge Script skills
Availability
Permission Required
Users with Manage automation permission in their profile can access this feature.


Set Up Functions

You can set up Functions in three steps:

  • Create a function.
  • Associate function to a workflow rule.
  • Test Functions integration.

To create a function

  1. Go to Setup > Automation > Actions > Function
  2. In the Functions page, click the Configure function.
  3. In the Configure custom function page, select a function from Gallery, existing function or write a new one using Deluge Script.
    Custom Function
  4. Click Save.

To associate function to a workflow rule

  1. Go to Setup > Automation > Workflow Automation > Rules.
  2. In the Workflow Rules page, click the Create Rule.
  3. In the Create New Rule tab, specify workflow rule parameters.
  4. Select function, under Instant Actions.
  5. Now select the function to be triggered.
  6. Click Save.
    Custom Function

To test the function integration

  1. Add test data in Zoho CRM according to your workflow rule criteria.
  2. Check for the data received from Zoho CRM via function, in your application.
  3. Modify your function code in Zoho CRM, if data is not received or if there is a data mismatch.
  4. Continue this test until you obtain the required data from Zoho CRM to your Application.

Important Notes

  • You can associate up to 6 (1 Instant Action and 5 Time-Based Actions) Functions per workflow rule.
  • You can execute only 5000 lines (Statements) in a single function call.
  • You can transfer data for a maximum of 10 CRM fields from Zoho CRM to third-party applications using function.
  • If you use function to update any CRM field, then after saving the record the updated field value will appear in the record detail page without having to reload the page.
    For example, if a function is configured to update lead rating value via the Data Enrichment tool, then after saving a record the field will be updated automatically. It will be highlighted for easy identification. (Note that, the popup will be displayed only once). 

  • You can retrieve data from other Apps to Zoho CRM using function.
  • You must update the API ticket regularly according to limits in third-party applications.
  • You will not receive any email notification, if the function integration stopped functioning due to any issue in a third-party API.
  • If there is any failure while connecting to Zoho Creator service, function will send the second notification after 15 min. Thereafter, the system will not send any notifications for that particular workflow trigger. Errors returned from Zoho Creator are shown under Reason for Failures section.
  • If you exceed the maximum count per day, the system will not send remaining function notifications to third-party applications and will notify the failure to Administrator.
  • Zoho CRM will send the data in following standard format for Date and Date Time fields to third-party applications:
    • Date: yyyy-MM-dd
    • Date Time: yyyy-MM-dd hh:mm
  • Limits for Functions:
    • Min calls per day - 20,000 + 500 calls per user license for the org.
      Max calls per day - 100,000 whichever is lower.
      For example, if you have 55 users in your organization, you will have a maximum of (55 x 500 + 20,000) = 47500 calls per day.
    • Integration Tasks - 25000 Zoho API calls/day using deluge.
    • Get Data & Post Data - 25000 calls/day (totally) 
    • Send Email - 1000 emails/day

Business Scenario

Roll up the deal amount to parent account

Summary

Roll-up amount from each deal (status is closed won) to Total Revenue (custom field) to related Account. If customer buys 10 times, You can see the total revenue from Account page, instead of pulling a report. Based on the Revenue from customer, later you can grade them type A, type B, or type C customers.

To configure this function, follow these steps:

  1. Log in to Zoho CRM.
  2. Open Setup > Automation > Workflow Automation > Rules > Create a workflow rule for the Deals module.
  3. Click Next.
    Custom Function
  4. Choose when you want to execute this rule. Now select Create or Edit option under execute based on a record action.
    Custom Function
  5. Click Done.
  6. Choose to which records you want to execute the rule. Select Records Matching the condition option and set the criteria as "Stage contains closed won".
    Custom Function
  7. Click Done.
  8. Now choose function as Instant action.
    Custom Function
  9. In the Configure function pop-up, click the Gallery link.

  10. In the Gallery page, click Configure for Roll-up Deal Amount to Account function.

  11. Specify values for the arguments as mentioned below:
    • Account-id: Choose "AccountId" column from the list of fields.
    • SumUpField: Specify the field you have in accounts module for the summation.
    • Click "Specify custom value" link and type your field name.

  12. Save the configuration. This will now automatically update the sum of the revenue generated by all the deals of an account in the account module.

Refer Error Codes

When the execution of function fails, one of the following error messages will be displayed in Zoho CRM:

HTTP Status Codes

  • 400 Bad Request - Often missing a required parameter.
  • 401 Unauthorized - No valid API key provided.
  • 402 Request Failed - Parameters were valid but request failed.
  • 404 Not Found - The requested item doesn't exist.
  • 500, 502, 503, 504 Server errors - Error in the third-party application.
  • Error Code 1 - Temporarily not able to connect to the API server. Check API server logs, firewalls settings for requests sent from CRM.

Custom Errors

  • Internal process failure - When the function is not executed due to errors in processing of the script.
  • Day limit reached - When the company has reached the maximum limit for the day.
  • Deluge Script - When the execution of workflow triggers fail due to errors in Deluge Script.

View Functions Usage Graph

Zoho CRM provides graphs that show the daily or weekly usage statistics of Functions across various features. You can view the alert usage from Settings > Setup Automation Actions > Functions.

The More Info link provides detailed information on the usage stats. Please note that the graph will cover the usage stats of the past 7 days.


SEE ALSO

    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Zoho Sign now offers specialized one-on-one training for both administrators and developers.

            BOOK A SESSION









                                        You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                            Manage your brands on social media

                                              Zoho Desk Resources

                                              • Desk Community Learning Series


                                              • Digest


                                              • Functions


                                              • Meetups


                                              • Kbase


                                              • Resources


                                              • Glossary


                                              • Desk Marketplace


                                              • MVP Corner


                                              • Word of the Day


                                                Zoho Marketing Automation

                                                  Zoho Sheet Resources

                                                   

                                                      Zoho Forms Resources


                                                        Secure your business
                                                        communication with Zoho Mail


                                                        Mail on the move with
                                                        Zoho Mail mobile application

                                                          Stay on top of your schedule
                                                          at all times


                                                          Carry your calendar with you
                                                          Anytime, anywhere




                                                                Zoho Sign Resources

                                                                  Sign, Paperless!

                                                                  Sign and send business documents on the go!

                                                                  Get Started Now




                                                                          Zoho TeamInbox Resources



                                                                                  Zoho DataPrep Resources



                                                                                    Zoho DataPrep Demo

                                                                                    Get a personalized demo or POC

                                                                                    REGISTER NOW


                                                                                      Design. Discuss. Deliver.

                                                                                      Create visually engaging stories with Zoho Show.

                                                                                      Get Started Now









                                                                                                          • Related Articles

                                                                                                          • Configuring Workflow Rules

                                                                                                            Workflow Rules in Zoho CRM, are a set of actions (email notifications, tasks and field updates) that are executed when certain specified conditions are met. These rules automate the process of sending email notifications, assigning tasks and updating ...
                                                                                                          • FAQs: Workflow Rules

                                                                                                            What is a workflow rule? Workflow rules in Zoho CRM are designed to enhance productivity of the users and reduce manual work by automating routine activities in a business process. They allow you to create rules that can trigger different action ...
                                                                                                          • FAQs: Workflow for Emails

                                                                                                            What's workflow rules for emails and why do I need it? In Zoho CRM, workflow rules for emails allow you to automate and streamline your communication processes. Workflow rules are a set of instructions that you can define to trigger automatic actions ...
                                                                                                          • Workflow Report

                                                                                                            Workflow rules play a crucial role in simplifying your business processes by automating various tasks. By defining specific conditions, you can determine whether a rule should be applied or not to the records in your system. This automation helps in ...
                                                                                                          • Creating Validation Rules Using Functions

                                                                                                            By using function you can create a validation rule where the value entered by the user needs to be verified outside the CRM database. You can even validate the fields like phone numbers, zip code and so on for a particular pattern by mentioning the ...
                                                                                                            Wherever you are is as good as
                                                                                                            your workplace

                                                                                                              Resources

                                                                                                              Videos

                                                                                                              Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                              eBooks

                                                                                                              Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                              Webinars

                                                                                                              Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                              CRM Tips

                                                                                                              Make the most of Zoho CRM with these useful tips.



                                                                                                                Zoho Show Resources