CRM Help

Custom Functions

Zoho CRM Custom functions help you to update the data in related CRM modules or third-party applications by executing easy to program scripts. When a record matchs the workflow criteria, workflow engine automatically triggers the custom function and update the CRM records. With custom 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 potential (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 potential is won and closed in CRM. Also, view the project link under an Account or Potential 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 potential status is "closed won", push the potential, 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 Potential record in CRM.

Target Audience

  • CRM Administrators who set up workflow rules for Users
  • Programmers with REST API and Deluge Script skills

Availability

Profile Permission Required: Users with the "Manage Workflow" permission can access this feature.

Set Up Custom Functions

You can set up custom functions in three steps:

  • Create a custom function.
  • Associate custom function to a workflow rule.
  • Test custom functions integration.

To create a custom function

  1. Click Setup > Automation > Workflow > Custom Function.
  2. In the Custom Functions page, click the Configure Custom 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 custom function to a workflow rule

  1. Click Setup > Automation > Workflow Rules.
  2. In the Workflow Rules page, click the Create a Workflow Rule.
  3. In the Workflow Rule page, specify workflow rule parameters.
  4. Under Workflow Actions, select the custom function to be triggered.
  5. Click Save.
Custom Function

 

To test the custom 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 custom function, in your application.
  3. Modify your custom function code in Zoho CRM, if there data is not received or 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) custom functions per workflow rule.
  • You can transfer data for a maximum of 10 CRM fields from Zoho CRM to third-party applications using custom function.
  • You can retrieve data from other Apps to Zoho CRM using custom function.
  • You must update the API ticket regularly according to limits in third-party applications.
  • You will not receive any email notification, if the custom function integration stopped functioning due to any issue in a third-party API.
  • If there is any failure while connecting to Zoho Creator service, custom 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 custom 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

Business Scenario

Roll up the potential amount to parent account

Summary

Roll-up amount from each potential (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 custom function, follow these steps:

  1. Log in to Zoho CRM.
  2. Open Setup > Automation > Workflow Rules > Create a workflow rule for the Potentials module.
    Custom Function
  3. Under the Excecute On section, select Create or Edit option.
    Custom Function
  4. Under the Rule Criteria section, set the criteria as "Stage contains closed won"
    Custom Function
  5. Under the Actions section, click Add Configure Custom Function.
    Custom Function
  6. In the Configure Custom Function page, click the Gallery link.
    Custom Function
  7. In the Gallery page, click Configure for Roll-up Potential Amount to Account function.
  8. Select Potential as your module.
  9. Specify values for the arguments as mentioned below:
    • AccountID: 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.
  10. Save the configuration to automatically update the sum of the revenue generated by all the potentials of an account in the account module.

Refer Error Codes

When the execution of custom 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 custom 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.

Top