Skip to main content

Zoho CRM Custom Function For Lead Phone Num Country Code Updation

Recently Zoho CRM Community had a blogpost on how to add country code to Leads along with a script to do the same. But the script seemed to leave a lot to be desired.
Here is a screenshot of their 10-line script:



These are the missing things we noticed with the above script:
1. First, there needs to be validation of whether the incoming phone number is empty or not. In the above script, even if the phone number is empty, '+91' will be added to the phone number. So, this means, in such records, phone number field will have only the value '+91'.
2. It would have been good to make it more generalized than hardcoding a specific country code into the script. Because this script is going to be applied to Leads, it is possible that the Leads may be coming in from various countries, given today's global nature of businesses. So having the script address just one country code is not going to satisfy today's growing business needs.
3. There is no checking in the script to see if the phone/mobile field already has country code in it. Suppose the phone number was already having country code, for example '+91 7788990000', then this script will give the result '+91+91 7788990000', because it doesn't do any checking if the existing phone number already has country code value prefixed with it.

Addressing the above issues, we have attempted our best to write a script which is more generalized, detailed and addresses several corner use cases. You can find it in Github here.



This Custom Function is for the Leads module in Zoho CRM. This code is in Deluge scripting language, which the language used across Zoho suite of products.  This is used to check an incoming lead to see if their phone num has the country dialing code. If not, then this code would fetch the appropriate code based on the'Country' field value from the Lead. 

Comments

Post a Comment

Popular posts from this blog

Achieve Zen with Zoho One

Zoho One.  Arguably the launch of the biggest software suite of Apps in the software industry yet.  When I first heard of this, I was not paying attention because I thought to myself "Just a rumor". But when I saw the launch today, it was mind-blowing! How could someone give away a suite of almost forty enterprise-ready apps for such a drop dead price?! But it's true and it is happening.  Drop-dead Pricing 38 cloud-based Apps + 55 mobile Apps. Must be a whopping price for so many Apps, right? That’s what I thought until I heard the price of $30 / month / user! That works out to about just $1.36/day/user, or rather, a little more than 15 cents/working hour/user! Cheaper than a cup of coffee! One for All. All for One. It’s is a very powerful concept. Come to think of it. All for one. All the business apps that you needed so far and possibly will ever need. One for all. One Suite. One login. One place for all your data so you can start connecting them together and making b

Why managing your Sales Pipeline with Excel is not a piece of cake 🎂

With Christmas round the corner, everywhere you see cakes and so the title seemed more apt for this time of the year 😉 Here is a recent conversation I had with a customer (rather, lead). He contacted me asking for some modification to an Excel template. This was a Sales Pipeline Tracker template, which he had downloaded (& started using) from this website . I have uploaded the file here with the customer's data masked https://docs.zoho.com/file/4ogu8568be2e1b3584c61a04203a17674007d Some issues in using Excel are immediately obvious as soon as you glance through the Excel file. Like a bachelor pad 🙄 Ever went into a bachelor pad and seen the mess? Same with the Excel data in here. Once you open the file, you can notice immediately that the data is not properly organised. See the first column for Client Name. Some have just first name, some just the last name, some have full name. Sometimes, it is just the initials! There is no specific idea o