Have you been wondering to find a way to validate SSN in Zoho CRM? Today we will show you a quick and real-time feature to alert you if you are entering the wrong format of the Social Security number of your customer.

In this article, I will be using the Accounts(Companies) Module in Zoho CRM, and our field name of SSN Number will be “SSN“.

validate ssn in zoho crm


Steps to Write down the Client Script function to validate SSN in Zoho CRM

Step 1: Navigate to the Developer Space

To create a field event client script function, you must first navigate to the Developer Space in Zoho CRM. This can be done by clicking on the gear icon in the top right corner of the screen, and then Navigating to the Developer Space section and Clicking on “Client Script”.

Step 2: Create a New Function

Once you click on Client Script. Click on the “New Script”.

Step 3: Select the Function Type

After you have clicked on “New Script”, you will be asked to select the type of function you want to create. For a field event client script function, select “Field Event” from the dropdown menu.

Step 5: Write the Function Code

Once you have defined the parameters for the function, you can start writing the code for the function. The code for a field event client script function will typically include instructions for modifying the behavior of a field based on a specific event

Step 6: Save the Function

Once you have written the code for the function, you can save it by clicking on the “Save” button in the top right corner of the screen.

Step 7: Test the Function

After you have saved the function, you can test it by navigating to the Create Page that the function is associated with, and performing the event that triggers the function. If the function is working correctly, you should see the expected behavior in the target field.


Client Script function to validate SSN in Zoho CRM

 * log("sample logging statement") --> can be used to print any data in the browser console.
 * ZDK module can be used for customising the UI and other functionalities.
 * return false to prevent <SAVE> action

var SSN = value;
var reg = /^(?!666|000|9\d{2})\d{3}-(?!00)\d{2}-(?!0{4})\d{4}$/;

if (SSN.match(reg)) {
    ZDK.Client.showMessage('SSN Validation Success', { type: 'success' });
} else {
    ZDK.Client.showMessage('SSN Validation failed, Enter Correct Number', { type: 'error' } );

Leave a Reply

Your email address will not be published. Required fields are marked *