Custom Function : Updating Lead Score.

Custom Function : Updating Lead Score.

Scenario: Updating Lead Score.


You may want to rank the leads in your CRM account in order to determine their sales-readiness. The scoring can be based on certain predefined values. This lead scoring can be done with custom functions.

You can have a
custom field for the Score and use custom functions to update the Lead Score based on certain values. When you update the fields in leads, the score will be updated automatically.

 

This custom function can also be used for other modules by making small changes in the custom function.

Please follow these steps:

  1. Log in to Zoho CRM with administrative privileges.
  2. Click Setup > Automation > Workflow > Create Rule.
  3. In the New Rule page, choose Leads module from the drop-down list and provide other rule details.
  4. Under Execute On, choose Create or Edit and then click Next.
  5. Specify the Rule Criteria. The rule will triggered only when a record meets the criteria mentioned here.
  6. In the Actions section, click on the Add button for Call Custom Functions.
  7. In the Configure Custom Function popup, click Write your own.
  8. Specify a name for the function.
  9. Build the Deluge Script based on the code given below.
void workflowspace.LeadsScoring(int Leadid,string Scorefield)
{
leadIDStr=input.Leadid.toString();
resp = zoho.crm.getRecordById("Leads",input.Leadid);
respStr=resp.toString();
respMap=respStr.toMap();
phone=ifnull(respMap.get("Phone"),"0"); 
email=ifnull(respMap.get("Email"),"0");
title=ifnull(respMap.get("Title"),"0");
website=ifnull(respMap.get("Website"),"0");
industry=ifnull(respMap.get("Industry"),"0");
point=0;
if(phone.length()  >  9)
{
point=2;
}
if(!((email.contains("gmail")  ||  email.contains("yahoo"))  ||  email.contains("outlook")))
{
point=(point  +  2);
}
if((website  !=  null)  ||  (website  !=  ""))
{
point=(point  +  2);
}
if(((title.contains("CEO")  ||  title.contains("manager"))  ||  title.contains("dir"))  ||  title.contains("VP"))
{
point=(point  +  2);
}
if(industry.contains("ERP"))
{
point=(point  +  2);
}
/////////////////////////////////////
info point;
if(point  >=  9)
{
Score="*****";
}
else if(point  >=  7)
{
Score="****";
}
else if(point  >=  5)
{
Score="***";
}
else
{
Score="";
}
info Score;
upresp = zoho.crm.updateRecord("Leads",leadIDStr,{ input.Scorefield : Score });
//info upresp;
}
Note: This custom is for the leads module and you can change the custom function for other modules also.

Please refer to the following link to know more about this feature:

Sincerely,
Prakash

    Access your files securely from anywhere







                            Zoho Developer Community





                                                  Use cases

                                                  Make the most of Zoho Desk with the use cases.

                                                   
                                                    

                                                  eBooks

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

                                                   
                                                    

                                                  Videos

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

                                                   
                                                    

                                                  Webinar

                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                   
                                                    
                                                  • Desk Community Learning Series


                                                  • Meetups


                                                  • Ask the Experts


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner




                                                            • Sticky Posts

                                                            • Zoho CRM Functions 53: Automatically name your Deals during lead conversion.

                                                              Welcome back everyone! Last week's function was about automatically updating the recent Event date in the Accounts module. This week, it's going to be about automatically giving a custom Deal name whenever a lead is converted. Business scenario Deals are the most important records in CRM. After successful prospecting, the sales cycle is followed by deal creation, follow-up, and its subsequent closure. Being a critical function of your sales cycle, it's good to follow certain best practices. One such
                                                            • User Tips: Auto-Create Opportunity/Deal upon Quote Save (PART 1)

                                                              Problem: We use quotes which convert to sales orders but Users / Sales Reps do not create opportunities / deals and go straight to creating a quote. This leads to poor reporting. Implementing this solution improves reporting and makes it easier for users.
                                                            • Custom Function : Automatically send the Quote to the related contact

                                                              Scenario: Automatically send the Quote to the related contact.  We create Quotes for customers regularly and when we want to send the quote to the customer, we have to send it manually. We can automate this, using Custom Functions. Based on a criteria, you can trigger a workflow rule and the custom function associated to the rule and automatically send the quote to customer through an email. Please note that the quote will be sent as an inline email content and not as a PDF attachment. Please follow
                                                            • Function #50: Schedule Calls to records

                                                              Welcome back everyone! Last week's function was about changing ownership of multiple records concurrently. This week, it's going to be about scheduling calls for records in various modules. Business scenario Calls are an integral part of most sales routines.. Sales, Management, Support, all the branches of the business structure would work in cohesion only through calls. You could say they are akin to engine oil, which is required by the engine to make all of it's components function perfectly. CRM
                                                            • Function #37: Create a Purchase Order from a Quote

                                                              Welcome back everyone! Last week, we learnt how to calculate the total number of activities for a lead and further take note of the activity count for particular dates. For instance, from the period of Demo to Negotiation. This week, let's look at a function that lets you create a Purchase Order instantly from a Quote. Business scenario: In any form of business, one of the most important things to do is to document the transactions. Naturally, negotiation, signing an agreement, placing an order,


                                                            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 Writer

                                                                                              Get Started. Write Away!

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

                                                                                                Zoho CRM コンテンツ








                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方




                                                                                                            • Recent Topics

                                                                                                            • Low Stock View

                                                                                                              We use the Low Stock view frequently as a guide to inform us when to reorder items, but the view is misleading because it does not take into account Purchase Orders that have already been raised. Unless you are aware and check item by item, this can lead
                                                                                                            • Improve History Feature in Zoho Inventory

                                                                                                              At present there is a "history" tab on Zoho Inventory Items, however this only shows a date and time stamp along with the users name. It doesn't say what was changed. What is the value of this if you can't see what was changed? My Ideal is to include
                                                                                                            • Payroll and BAS ( Australian tax report format )

                                                                                                              Hello , I am evaluating Zoho Books and I find the interface very intuitive and straight forward. My company is currently using Quickbooks Premier the Australian version. Before we can consider moving the service we would need to have the following addressed : 1.Payroll 2.BAS ( business activity statement ) for tax purposes 3.Some form of local backup and possible export of data to a widely accepted format. Regards Codrin Mitin
                                                                                                            • Show backordered items on packing slip

                                                                                                              We send out a lot of large orders, and often there are one or two things backordered. How can I fix the packing slips to show quantity ordered  & quantity packed There should also be the ability to "ship" 0 of an item so the receiver knows that things
                                                                                                            • Document | Files

                                                                                                              The vendor "Partial matches" still not fixed here after years of putting up with having to select most vendors manually ! ( again, the banking "Transaction rules" would solve a lot of these issues ) Some unwanted, irrelevant pdf's also arrive. It would
                                                                                                            • books+POS+ tap to pay+ stripe

                                                                                                              So in the UK we now have tap to pay with stripe. So we can use the stripe app as a POS terminal. Brilliant news. Can we hope that the Books App might add this feature ASAP. It would be great to have one system rather than using the not very good Square
                                                                                                            • Canvas Form View - Client Script Page on load - Url params not working

                                                                                                              We have a custom module with a canvas page for form view. We have a button in Customers module to open this canvas page using invokeurl function. We send few parameters as in the URL as query parameters. https://crm.zoho.in/crm/orgxxxxxxxx/tab/CustomModule12/create/canvas/64333200000261xxxx?layoutId=643332000002605001&c=${Customers.Customer
                                                                                                            • Sending Recruit SMS's to Zoho Cliq - Or tracking in the Messages module in Recruit?

                                                                                                              Is there any way to send SMS Gateway messages in Recruit to ZOho Cliq? We use 2-way SMS massages a lot in Zoho Recruit to speed up communication with Candidates. However the only way to keep track of received SMS's is by keeping a look out for the Email
                                                                                                            • This mobile number has been marked spam. Please contact support.

                                                                                                              Hi Support, Can you tell me why number was marked as spam. I have having difficult to add my number as you keep requesting i must use it. My number is +63....163 Or is Zoho company excluding Philippines from their services?
                                                                                                            • Zohomail does not support additional fields in mailto links

                                                                                                              Hello, I set up Zohomail as default composer in Firefox according to manual here: https://www.zoho.com/mail/help/defaultcomposer.html#alink2 Later, I wanted to use this functionality to answer in a Linux mailing list thread using mailto link: mailto:xxxxx@kernel.org?In-Reply-To=%3C727o0521-q24p-s0qq-66n0-sn436rpqqr1p@example.com%3E&Cc=xxxxx%example.org&Subject=Re%3A%20%5BPATCH%20v2%28%29
                                                                                                            • Is it possible to set a customer context variable in Zobot

                                                                                                              Hi, I want to use a context variable to route users down different paths in my Zobot chat flow. I know I can do this when the user enters data. But I want to know if I can use a variable that is 'hard coded' on the card, that the user is unaware of. Use
                                                                                                            • Cannot change Blog Title

                                                                                                              There is nowhere to change the blog title. You can change the blog URL but that is making no difference to the text "Enter Your Post Title" am I missing something?
                                                                                                            • Pending Sales Order Reports

                                                                                                              Pending sale order report is available for any single customer, Individual report is available after 3-4 clicks but consolidated list is needed to know the status each item. please help me.
                                                                                                            • Manage monthly tasks with projectsf

                                                                                                              Hi All I run a finance and operations team where we need both teams to complete monthly tasks to ensure we hit our deadlines. Can Zoho projects be used for this. There many finance focused tools but we have Zoho one so want to explore Thanks Will
                                                                                                            • Kaizen #203 - Answering Your Questions | Handling API Limits and Error Responses

                                                                                                              Hi Everyone, Welcome back to yet another post in the Kaizen Series! We appreciate your keen participation in the 200th milestone celebration of the Kaizen series. We will continue to answer the queries we received through the feedback. When working with
                                                                                                            • How to verify website ownership with google search console

                                                                                                              Hi, I am having a free .in domain provided by Zoho I have created a website on it now I want to verify my ownership to google webmaster. Can you please help me how to do that.
                                                                                                            • Kaizen #89 - Color Coding using Client Script

                                                                                                              Hello everyone! Welcome back to another exciting Kaizen post. Today let us see how you can apply color codes to the List and Detail Pages of Zoho CRM using Client Script. Need for color code in Zoho CRM When you mark things with different colors as a
                                                                                                            • "SPF record exceed the allowed limit of 10"

                                                                                                              Hi, I was wondering if there were a "universal Zoho SPF record" that would allow all my configured Zoho services that email things to meet this limitation ? or do I have to have an entry for mail, com, billing, etc?
                                                                                                            • Zoho Mail android app update: Block & reject future emails, Report phishing, Spam alerts, Suspicious URL detection

                                                                                                              Hello everyone! In the most recent Zoho Mail Android app update, we have brought in support for the following features: Block & reject future emails Report Phishing Spam alerts in the mail details screen. Suspicious URL detection. Block & reject future
                                                                                                            • What is Resolution Time in Business Hours

                                                                                                              HI, What is the formula used to find the total time spent by an agent on a particular ticket? How is Resolution Time in Business Hours calculated in Zohodesk? As we need to find out the time spent on the ticket's solution by an agent we seek your assistance
                                                                                                            • Animated GIF Images in Chat

                                                                                                              I know this seems to be a small feature request but in a recent Cliq update Zoho disabled autoplay for animated GIFs posted in Cliq conversations. We think this was not a good change. In our organization, animated GIFs in a chat play a role in expressing
                                                                                                            • I can't seem to login in to Mail Apps of MacOS /IOS

                                                                                                              Hi, i'm having trouble in signing in to mail apps from IOS. It's always come back to wrong passwords. But i already changed my password like 3 times. But still it says wrong credentials
                                                                                                            • Profile Image Showing Incorrectly in Zoho Mail

                                                                                                              Hi everyone, I’m facing a serious issue with Zoho Mail. The profile image showing for my email address is incorrect — it’s not my image. When I send an email to my Gmail account, it displays someone else’s image. This looks very suspicious and can make
                                                                                                            • I need access to my old email

                                                                                                              I need access to my old email bromzeman@zoho.com to verify it for forwarding. I can’t access the inbox to get the confirmation code. Please assist with recovery or forwarding. as you might already know, they made alot of the email addresses to have that
                                                                                                            • Set Defaults for Email Groups

                                                                                                              Is there a way to set defaults for all of the groups that I establish as a moderator? For example, I want every group I establish to have the following settings: 1. Moderator is <user> 2. User is <user>, <user> 3. Notifications for new group turned
                                                                                                            • LOGS FOR RECEIVED MAIL ( READ DATE & TIME)

                                                                                                              In Zoho mail we can extract the read logs of received mails so that we can see when we have read the mail and at what time & we have read it.
                                                                                                            • Domain verification probem

                                                                                                              Hello, i use a domain from Namecheap with hosting from Cinfu when i try to verify my domain on zoho i get "TXT Verification failure" i even tried the HTML verification and the code appears but also giving me the verification failure error.
                                                                                                            • Switching to Cloudflare email routing from Zoho Mail

                                                                                                              Hello, I'm currently working on migrating from Zoho Mail to Cloudflare's email routing solution. This requires changing MX and TXT records for our custom domain - when we do this, will our users still be able to log into their accounts and access an archived
                                                                                                            • Un Subscription Button

                                                                                                              How can i Add the Un Subscription Button in Zoho mail
                                                                                                            • Documents unable view and need to downlad

                                                                                                              I can't view .doc files in Zoho mail unless I download them, but I can view PDF files without downloading.
                                                                                                            • we encountered a problem while sending your email. please try again later.

                                                                                                            • Adding and removing people from groups

                                                                                                              We're having problems adding people to a group. Apparently Zoho has one email address and will not recognize a different email address.
                                                                                                            • MAIL SEARCH IS NOT WORKING

                                                                                                              THIS ISSUE HAS BEEN BUGGING ME SINCE MORNING, PLEASE RESOLVE THIS AT THE EARLIEST
                                                                                                            • URL Parameter on Help Center SIgn in link

                                                                                                              Is it possible to add a url parameter to the sign in link on the Help Center?
                                                                                                            • migrating from HelpScout

                                                                                                              I am attempting to import a conversation file from helpscout into desk and am receiving size errors. What is the current file size restriction. Does anyone have any tips for a successful migration?
                                                                                                            • Layout Rules Don't Apply To Blueprints

                                                                                                              Hi Zoho the conditional layout rules for fields and making fields required don't work well with with Blueprints if those same fields are called DURING a Blueprint. Example. I have field A that is used in layout rule. If value of field A is "1" it is supposed to show and make required field B. If the value to field A is "2" it is supposed to show and make required field C. Now I have a Blueprint that says when last stage moves to "Closed," during the transition, the agent must fill out field A. Now
                                                                                                            • Article Name Sorting in Zoho Desk Knowledge Base (agent / admin side)

                                                                                                              Dear Zoho Desk Support, We are writing to request an enhancement to the Knowledge Base management feature within Zoho Desk. Currently, there is no option to sort articles by their name, which significantly hinders efficient article management, especially
                                                                                                            • How to parse JSON data with SQL in Zoho Analytics?

                                                                                                              Hi all, I have a column with JSON data. I want to show this column in a chart, but it is very messy, and no JSON parsing function is supported on Zoho Analytics. data example: {"id": 5, "status": "false", "date": "15/10/22"} what I want to do in SQL is
                                                                                                            • Ability to turn off "Would you like this amount to be reflected in the Payment field?" message

                                                                                                              Team, Is there any way to turn off the message" Would you like this amount to be reflected in the Payment field?" when I make a payment? This is so annoying. This happens EVERY TIME I put an amount in the Payment Made field.
                                                                                                            • Add an Equation Field (Or update the Formula Field)

                                                                                                              Hi, I would like to be able to have one field as a Text Field with QR Code, and then have multiple Equation/Formula Fields that then take parts of that fields data with LEFT, MID, RIGHT, REGEX, etc. Thanks Dan
                                                                                                            • Next Page