Block Duplicate Phone Numbers?

Block Duplicate Phone Numbers?

We provide more phone support than we do email support. As a result, we do not collect many email addresses. Desk prevents duplicate contacts by checking email only. We need to check for duplicate phone numbers also.

A solution we found is the following function. However, we are already using a validation rule to format the phone number using regex. We are unable to create two validation rules for the same Phone field. We understand a single custom function is necessary to combine both validations.

Another solution is to create a NEW phone field and set it as UNIQUE but this creates other major issues like needing to move the current values to another new phone field. Also the new phone field is not actively visible in certain views like with the default phone field. Second, the default phone field is not able to set as unique so a custom function is required.

The custom function must  first check format validation using the following regex "^\d{10}$". Second, the custom function checks the database for duplicate phone numbers and blocks the creation of the contact if a match is found.

Can someone please help to complete the function? Below was written for CRM but we need it to work in Desk.

  1. entityMap = crmAPIRequest.toMap().get("record");
  2. ph = entityMap.get("Phone");
  3. response = Map();
  4. search = zoho.crm.searchRecords("Contacts", "(Phone:equals:"+ph+")");
  5. if(search.size() = 0)
  6. {
  7. response.put('status','success');
  8. }
  9. else
  10. {
  11. response.put('status','error');
  12. response.put('message','Phone number already exists');
  13. }
  14. return response;


      • Sticky Posts

      • Webinar 2: Supercharged customer support for growing business

        Join us for this webinar and learn how to step up your support game using a real-time communication platform to generate happier, more successful customers. In this live webinar, we will will discuss the importance of SalesIQ for your support team and how it can help you:  Understand your customers better and their journeys to proactively support and engage them even before they ask for help.  Integrating real time conversations into Zoho Desk’s Support, providing a conversational customer service
      • Customize Colors of your Customer Self Service Portal

        You asked for it. We heard you. We're happy to roll out the most sought after feature request, Customizing the Colors of your Customer Self-service Portal. Now you can set the color of your customer portal to mimic your company's web site, so that your customers visiting the portal will not feel alienated by the default theme.  Go ahead and configure the color of the header, tabs, fonts and background according to your needs. You can either choose between default color themes like Blue, Grey, Green
      • Edit and Delete options in Comments

        A lot of teams have been using ticket comments extensively to collaborate everyday. Notification Center further improved this experience by bringing real-time updates. As we continue to build more improvements to this experience, we've shipped a small-yet-important
      • 2024 Email Authentication Standards: Elevating Security with Google and Yahoo

        In contemporary email communication, email authentication plays a pivotal role in mitigating email fraud, spam, and phishing attacks. Brace yourself for a new level of security. Starting February 2024, Gmail and Yahoo will be implementing robust email
      • Announcing the New and Improved Article Editor

        KBase articles are known to help customers, find solutions to problems on their own and set the stage for ticket deflection. That said, the way you present your KBase content is the clinching factor that ensures your customers stick around to consume it.  We took it upon ourselves to build an editor that allows you to publish articles without delving into the code. Well, at least for the most part. With more options and a redefined interface, the article editor in Zoho Desk is now better than ever!