Custom SalesSignal

Custom SalesSignal

The SalesSignals feature in Zoho CRM provides real-time notifications of all touch points from your leads, contacts, or potential customers. You can keep track of all the customer interactions across various channels and follow-up with them from one central place, your Zoho CRM account. The SalesSignals notifications are displayed when you click  [the Notifications icon] on the top-right corner of the Zoho CRM home page.
Refer Configure and View SalesSignals  to know more about the  types of SalesSignals displayed in Zoho CRM and when they will be displayed.

You can now use the Zoho Developer Console to create custom sales signals and raise them when receiving notifications from any third-party application too and show them to the sales reps inside Zoho CRM. To achieve this, you need to build an extension using Zoho Developer Console or check out for such extensions that are already available on the Zoho Marketplace.

This document will guide through the step-by-step procedures of creating and raising SalesSignals for both native extensions and third-party integrations.
 

Define and Raise Signals in Native Extensions

Native extensions are a set of custom features bundled together to extend the functionality of your Zoho CRM system without the influence of any other third-party service. For instance, writing a new custom workflow rule to set up alerts/notifications inside your Zoho CRM, whenever a deal stays dormant in the pipeline for a long period of time (this time period can be defined by the users based on their requirements).

Configuring SalesSignals for native extensions involves two steps:
  1. Defining a SalesSignal 
  2. Raising a SalesSignal 

Define a Signal

The first step is to create and define the SalesSignal in Zoho Developer Console.

To create a SalesSignal
  1. In the Zoho Developer console homepage, click Extensions for Zoho CRM.
  2. Click Edit below the extension in which the SalesSignal has to be generated.
  3. In your Extension's details page, click SalesSignal in the left pane.
  4. In the SalesSignal page, click Define Signal.
  5. Provide the following details to define the Signal.
    1. Signal Name  - This is the name that will be displayed in the settings page, where the users can turn on/off the signals.
    2. Namespace - The unique namespace thay is used to address the signal in any custom function.
    3. Icon - Favi icon that will shown along with the notification inside Zoho CRM.
  6. Click Save.

 

Raise a Signal

You can raise a signal by invoking the deluge task given below. This function can be associated to a scheduler/ custom function so that you get a notification whenever a deal has been dormant in the sales pipeline for a particular period of time. The following sample function can be used to raise a sales signal whenever whenever a deal remains in the Qualification stage for 10 days.
  1. resp = zoho.crm.getRecords("Deals");
  2. for each usersVal in resp
  3. {
  4.   id = usersVal.get("id");
  5.   time = (usersVal.get("Modified_Time")).toTime();
  6.   stage = usersVal.get("Stage");
  7.   NumberofDaysinQualification = 10;
  8.   NumberofDays = days360(time,zoho.currentdate);
  9.   if ((stage == "Qualification") && (NumberofDays.toLong() > NumberofDaysinQualification))
  10.   {
  11.     flag = 1;
  12.   }
  13.   if (flag == 1)
  14.   {
  15.     signalMap = map();
  16.     signalMap.put("signal_namespace", "<signal_namespace>");
  17.     signalMap.put("email", "<email_present_in_either_lead's_or_contact's_record>");
  18.     signalMap.put("subject", "Alert for Deal Stuck in Quialification Stage");
  19.     signalMap.put("message", "Your Deal is Stuck. Please look into it. Thanks !");
  20.     actionsList = List();
  21.     actionMap = map();
  22.     actionMap.put("type", "link");
  23.     actionMap.put("display_name", "View Potential");
  24.     actionMap.put("url", "/crm/EntityInfo.do?module=Potentials&id=" + id);
  25.     actionsList.add(actionMap);
  26.     signalMap.put("actions", actionsList);
  27.     result = zoho.crm.invokeConnector("raisesignal", signalMap);
  28.     info result;
  29.    }
  30. }

Whenever this signal is raised, you will receive a notification in Zoho CRM as shown below.
 

Define and Raise signals for Third-party Integrations

Third-party integration extensions allow users to link their Zoho CRM accounts with outside services such as Pandadoc, Google, Zendesk, SurveyMonkey,etc. Now once this integration is achieved, the users might require timely updates of the changes from the third-party service. For example, Consider that you have integrated your Zoho CRM with SurveyMonkey. You have created a survey using SurveyMonkey and sent it to your Customers and Prospects and want to receive timely notifications whenever a customer views your survey or has responded to it. This can be achieved by setting up SalesSignals using Zoho Developer Console.
  1. Defining a SalesSignal 
  2. Registering a Webhook request 
  3. Raising a SalesSignal 
 

Define a Signal

To create a SalesSignal for a third-party application
  1. In theZoho Developer Consolehomepage, click Extensions for Zoho CRM.
  2. Click Edit below the extension in which the SalesSignal has to be generated.
  3. In your Extension's details page, click SalesSignal in the left pane.
  4. In the SalesSignal page, click Define Signal.
  5. Provide the following details to define the Signal,
    1. Signal Name  - This is the name that will be displayed in the settings page, where the users can turn on/off the signals.
    2. Namespace - The unique namespace thay is used to address the signal in any custom function.
    3. Icon- Favi icon that will shown along with the notification inside Zoho CRM.
  6. Click Save.

 

Register a Webhook

Most services provide webhook support for other services to register for notifications when specific events occur in the third-party service. This can be done either manually(if the servcie has a provision to do that) by simply specifying the necessary details or programatically. Inorder to register for the Webhook, you need a Webhook URL.

Standalone deluge functions can be defined and can be exposed as REST APIs. And this REST API generated for the function can be registered as the Web hook URL in a third-party service.

And when this URL gets invoked by the third-party service, the deluge callback function gets executed and the raise signal task added by you will generate a sales signal.

Define a deluge function
So the first step in registering a Webhook is to define a deluge function that can be exposed as REST API. The Syntax to define a function is:
  1. <function_name> (map requestMap)
  2. {
  3. }
 
All functions exposed as REST APIs will have a map variable defined as the input variable.  It contains all the data posted to the API and has three keys defined :
  1. Parameters
  2. Headers
  3. RequestString
Once this function is defined and saved, the REST API URL will be generated. This URL is the Webhook URL that has to be provided to the third-party application. A sample REST API URL pattern is given below,
  1. http://platform.zoho.com/crm/v2/settings/custom_function/%3Cfunction_name%3E/execute

After defining the deluge function and obtaining the Webhook URL, you'll have to register the webhook in the third-party service. Before registering the webhook we should know the type of authentication provided by the third-party.

If the third-party service provides token based authentication, a simple POST URL task can be used for this purpose. Refer to POST URL  to learn how to write a POST URL script.

If the third-party service uses OAuth 2.0 authentication, you have to create a connector  and create an API associated to it. For any third-party service, the API URL and its parameters can be obtained from their developer documentation.

Once this connector API is created, you can write a custom function to invoke the Connector API. Invoking this connector API will be done based on the option provided by the third-party for registering the Webhook. Certain services allow registering the webhook at the record level(whenever a particular record is credited or modified) while some allows at the service level (whenever there is any change in the service).
The webhook_url can be defined using the format given as below,
  1. webhook_url="http://platform.zoho.com/crm/v2/settings/custom_function/%3Cfunction_name%3E/execute%22
To obtain the apikey value to be used in custom function, use the following code
  1. getmap = { "nameSpace" : "<portal_name.extension_namespace>"};
  2. apiresponse = zoho.crm.invokeConnector("crm.zapikey", getmap);
  3. apikey = apiresponse.get("response");
SurveyMonkey provides the option at record level. So whenever the survey is created in CRM, we have to trigger a workflow which will execute the custom function (which have source code for registering webhook). A sample custom function is given below, using the webhook_url and apikey got through the above steps.
  1. survey_id = input.surveymonkey_details_.get("surveymonkey.Survey_ID");
  2. crm_signal_webhook_url = webhook_url+"?survey_id=" + survey_id + "&zapikey="+apikey;
  3. map = { "survey_id" : survey_id, "crm_signal_webhook_url" : crm_signal_webhook_url };
  4. response = zoho.crm.invokeConnector("surveymonkey.surveymonkeyconnector.registerwebhook",map);
Write a workflow rule to invoke this custom function whenever a new survey is created using SurveyMonkey in Zoho CRM. With this, the webhook registration is successful.
You can also register a webhook at the time of extension installation by including the function as a Post install Script .
 

Raising a Signal

Raising a SalesSignal will be done whenever there is a change in the third-party. For example, in SurveyMonkey whenever a user has completed a survey the details of the survey will be pushed toZoho CRM.

You need to include the following deluge task to push the signal to Zoho CRM. You will get all the details from the third-party service in requestMap variable as explained before.
  1. survey_id=input.requestParamMap.get("survey_id");
  2. response_id=input.requestContentStr.getJSON("object_id");
  3. map={ "survey_id" : survey_id, "response_id" : response_id };
  4. response = zoho.crm.invokeConnector(("surveymonkey.surveymonkeyconnector.getsurveyresponsedetails"),map);
  5. responseObj=response.toString().getJSON("response");
  6. EMAIL=responseObj.getJSON("metadata").getJSON("contact").getJSON("email").getJSON("value");
  7. SUBJECT="Survey Monkey Responded";
  8. MESSAGE="Response from survey monkey";
  9. DETAIL_VIEW_LINK_NAME="View Survey Response";
  10. DETAIL_VIEW_LINK_URL=responseObj.getJSON("analyze_url");
  11. map={ "email" : EMAIL, "subject" : SUBJECT, "message" : MESSAGE, "preview_link_name" : DETAIL_VIEW_LINK_NAME, "preview_link_url" : DETAIL_VIEW_LINK_URL };
  12. return map.toString(); 

    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

                                                                                                          • Custom Actions

                                                                                                            This guide will help you with the following: Create Custom Actions  Associate with Workflow Rules  Manage Custom Actions  Zoho Developer provides various options to automate repetitive tasks and implement customizations that meet your business needs. ...
                                                                                                          • Custom Permission

                                                                                                            Introduction Custom permissions are new profile permissions that you can provide in the extension you develop. These permissions will be displayed under the PERMISSIONS tab on the extension detail page. Only the admins of a Zoho Desk portal will be ...
                                                                                                          • Custom Functions

                                                                                                            The guide will help you with the following: Create Custom Functions Program Custom Functions  Test Custom Functions  Associate with Workflow Rules  Manage Custom Functions  Custom functions help in automation where procedural logic is required, which ...
                                                                                                          • Custom Schedules

                                                                                                            This guide will help you with the following: Create Schedules  Write Custom Function  Edit Schedules  Delete schedules Schedules are automated user-defined actions, which can be performed through custom functions either at a particular time or on a ...
                                                                                                          • Customization - Using Custom Buttons

                                                                                                            This guide will help you with the following: Create Custom Button  Define Button Action  Edit Custom Button  Delete Custom Button  In addition to modules, fields, pages, links, and a lot of other elements, Zoho Developer also allows you to create new ...
                                                                                                            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