Add the international call prefix '+' to a phone number
Any business involves a lot of communication. The most preferred way is to make a phone call. To make your life easier, Zoho CRM lets you call directly from the system. Naturally, you need an international call access code, which is the '+' symbol.
This custom function automatically adds the symbol to the phone number field. Additionally, this custom function also removes any alphabetical or special characters from the information in a numerical field. For instance, if you enter the phone number as "555-24r56" by mistake, it automatically changes to "+5552456".
Getting started with the function:
- Go to Setup > Automations > Actions > Functions > Configure Function > Write your own.
- Provide a name for the function. For example: "International call prefix".
- Select the module to be associated as Leads. Add a description(optional).
- Copy the code given below.
- Click "Edit Arguments".
- Enter the name as "leadId" and select the value as "Lead Id".
- Enter the name as "phone" and select the value as "Phone".
- Click Save & Execute Script.
- Save the changes.
alphanumeric = (input.phone).getAlphaNumeric(); numeric = alphanumeric.removeAllAlpha(); info numeric ; number = "+" + numeric ; mp=map(); mp.put("Phone",number); update=zoho.crm.update("Leads", leadId.toLong(), mp); info mp; info update;
- The code is zoho.crm._getRecordById for Version 1.0 of APIs.
- You can use the code for any modules. Change the name of the module from 'Leads' to whichever module you prefer and update the code accordingly.
Found this useful? Try it out and let us know how it works! If you have questions, do not hesitate to ask! Share this with your team if you find it useful!