Associate Functions in Workflow Rules
How Can I...
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.
- 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.
- CRM Administrators who set up workflow rules for Users
- Programmers with REST API and Deluge Script skills
You can set up Functions in three steps:
- Create a function.
- Associate function to a workflow rule.
- Test Functions integration.
To create a function
- Go to Setup > Automation > Workflow Automation > Function.
- In the Workflow Functions page, click the Configure function.
- In the Configure function page, select a function from Gallery, existing function or write a new one using Deluge Script.
- Click Save.
- Go to Setup > Automation > Workflow Automation > Rules.
- In the Workflow Rules page, click the Create Rule.
- In the Create New Rule tab, specify workflow rule parameters.
- Select function, under Instant Actions.
- Now select the function to be triggered.
- Click Save.
- Add test data in Zoho CRM according to your workflow rule criteria.
- Check for the data received from Zoho CRM via function, in your application.
- Modify your function code in Zoho CRM, if data is not received or if there is a data mismatch.
- Continue this test until you obtain the required data from Zoho CRM to your Application.
- 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.
- 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 the 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:
Roll up the deal amount to parent account
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:
- Log in to Zoho CRM.
- Open Setup > Automation > Workflow Automation > Rules > Create a workflow rule for the Deals module.
- Click Next.
- Choose when you want to execute this rule. Now select Create or Edit option under execute based on a record action.
- Click Done.
- 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".
- Click Done.
- Now choose function as Instant action.
- In the Configure function pop-up, click the Gallery link.
- In the Gallery page, click Configure for Roll-up Deal Amount to Account function.
- 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.
- 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.
When the execution of function fails, one of the following error messages will be displayed in Zoho CRM:
- 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.
- 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.
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.