+ Start a Discussion
Sakthi169Sakthi169 

How to check the mobile no exist or not in salesforce using php

Hi 

I create the form with mandatory field(Name,Mobile,city,Email,Gender).I create the form and insert the value into salesforce also.
But i need to throw the error message if mobile no is exist in salesforce and cannot submit without change the mobile no.
How can i do this anyone help????
Best Answer chosen by Sakthi169
Sumit Kumar Singh 9Sumit Kumar Singh 9
You can try this - 
<?php
// session_start() has to go right at the top, before any output!
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>REST/OAuth Example</title>
    </head>
    <body>
        <tt>
            <?php

            require_once ('soapclient/SforcePartnerClient.php');
            require_once ('soapclient/SforceEnterpriseClient.php');

            define("USERNAME", "xxxxxxx");
            define("PASSWORD", "xxxxxx");
            define("SECURITY_TOKEN", "xxxxxxx");
			$First=$_POST['fname'];
			$Last=$_POST['lname'];
			$PersonMobilePhone=$_POST['mobile'];
			$Email=$_POST['u_email'];
			//$Landline=$_POST['landline'];
			//Print_r($_POST);
			//exit;

            try {
                //echo "<table border=\"1\"><tr><td>";
               // echo "First with the enterprise client<br/><br/>\n";

                $mySforceConnection = new SforceEnterpriseClient();
                $mySforceConnection->createConnection("soapclient/enterprise.wsdl.xml");
				$mySforceConnection->setEndpoint('https://test.salesforce.com/services/Soap/c/36.0/0DFO000000001Oi');

               if (isset($_SESSION['enterpriseSessionId'])) {
                    $location = $_SESSION['enterpriseLocation'];
                    $sessionId = $_SESSION['enterpriseSessionId'];

                    $mySforceConnection->setEndpoint($location);
                    $mySforceConnection->setSessionHeader($sessionId);

                    //echo "Used session ID for enterprise<br/><br/>\n";
                } else {
                    $mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);

                    $_SESSION['enterpriseLocation'] = $mySforceConnection->getLocation();
                    $_SESSION['enterpriseSessionId'] = $mySforceConnection->getSessionId();

                   // echo "Logged in with enterprise<br/><br/>\n";
                }
				//echo "<br/>Now, create some records<br/><br/>\n";
				//////////////////////////////////////////////////////////////////////////////////////////
				// Here we are retrieving the record based on the condition "where PersonMobilePhone='".$PersonMobilePhone."'"", You can change it whatever you want.
////////////////////////////////////////////////////////////////////////////////////////////////////////////
				$query = "SELECT Id, FirstName, LastName, PersonMobilePhone from Account where PersonMobilePhone='".$PersonMobilePhone."'";
				$response = $mySforceConnection->query($query);
				$count=0;
                foreach ($response->records as $record) {
                    $count++;
                    break;
                }
                // if count is greater than 0, this means phone alredy exists
                if($count > 0) {
                    echo "Phone no. already exists";
			    } else {
				//Phone no. doesn't exist create the record.
				$records = array();
                $records[0] = new stdclass();
                $records[0]->FirstName = $_POST['fname'];
                $records[0]->LastName = $_POST['lname'];
                $records[0]->PersonMobilePhone = $PersonMobilePhone;
				$records[0]->CustomLandLine__c = '';
				$records[0]->City__c = 'Mumbai';
				$records[0]->Source__c = 'Database';
					$records[0]->OwnerId = '00590000002QqfJ';
				//	$query = "SELECT Id, FirstName, LastName, PersonMobilePhone from Account where LastName='test'";
               // $response = $mySforceConnection->query($query);
				 $response = $mySforceConnection->create($records, 'Account');
				 Print_r($response);
				/* if(!$response)
				 {
					 echo"vcbgvbvg";
				 }
				Print_r($response);
exit;
              /*  $ids = array();
                foreach ($response as $i => $result) {
                   // echo ($result->success == 1) 
                         //   ? $records[$i]->FirstName." ".$records[$i]->LastName
                          //      ." ".$records[$i]->PersonMobilePhone." created with id "
                            //    .$result->id."<br/>\n"
                         //   : "Error: ".$result->errors->message."<br/>\n";
                    array_push($ids, $result->id);
					//Print_r($response);
				   
				  // Exit;
                }*/
				}

				
				
                
			}catch (Exception $e) {
				
    
}
		
			?>
        </tt>
    </body>
</html>
Hope, this helps you.

Thanks, 
Sumit Kumar Singh

All Answers

Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello Umadevi,

Have you created your form using HTML and PHP OR Visualforce and APEX?
OR you just exported the HTML from WebToLead?
Can you pls, paste your form code here, so that I can have a look.

Thanks,
Sumit 
Sakthi169Sakthi169
Hi Sumit,

This is my simple form
<!DOCTYPE html>
<html>
<head>
<title> Simple PHP contact form with MySQL and Form Validation </title>
</head>
<body>
<h3> Contact US</h3>
<form action="insert_customer.php" method="post">
 First Name:<br>
  <input type="text" name="fname" ><br>
  Last Name:<br>
  <input type="text" name="lname" ><br>
   Mobile:<br>
 <input type="number"  name="mobile" ><br>
  Email:<br>
  <input type="email" name="u_email" ><br>



 
<input type="submit" value="Submit"><br>
</form>
</body>
</html>

And my PHP Page is like this
<?php
// session_start() has to go right at the top, before any output!
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>REST/OAuth Example</title>
    </head>
    <body>
        <tt>
            <?php

            require_once ('soapclient/SforcePartnerClient.php');
            require_once ('soapclient/SforceEnterpriseClient.php');

            define("USERNAME", "xxxxxxx");
            define("PASSWORD", "xxxxxx");
            define("SECURITY_TOKEN", "xxxxxxx");
			$First=$_POST['fname'];
			$Last=$_POST['lname'];
			$PersonMobilePhone=$_POST['mobile'];
			$Email=$_POST['u_email'];
			//$Landline=$_POST['landline'];
			//Print_r($_POST);
			//exit;

            try {
                //echo "<table border=\"1\"><tr><td>";
               // echo "First with the enterprise client<br/><br/>\n";

                $mySforceConnection = new SforceEnterpriseClient();
                $mySforceConnection->createConnection("soapclient/enterprise.wsdl.xml");
				$mySforceConnection->setEndpoint('https://test.salesforce.com/services/Soap/c/36.0/0DFO000000001Oi');

               if (isset($_SESSION['enterpriseSessionId'])) {
                    $location = $_SESSION['enterpriseLocation'];
                    $sessionId = $_SESSION['enterpriseSessionId'];

                    $mySforceConnection->setEndpoint($location);
                    $mySforceConnection->setSessionHeader($sessionId);

                    //echo "Used session ID for enterprise<br/><br/>\n";
                } else {
                    $mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);

                    $_SESSION['enterpriseLocation'] = $mySforceConnection->getLocation();
                    $_SESSION['enterpriseSessionId'] = $mySforceConnection->getSessionId();

                   // echo "Logged in with enterprise<br/><br/>\n";
                }
				//echo "<br/>Now, create some records<br/><br/>\n";

                $records = array();

                $records[0] = new stdclass();
                $records[0]->FirstName = $_POST['fname'];
                $records[0]->LastName = $_POST['lname'];
                $records[0]->PersonMobilePhone = $PersonMobilePhone;
				$records[0]->CustomLandLine__c = '';
				$records[0]->City__c = 'Mumbai';
				$records[0]->Source__c = 'Database';
					$records[0]->OwnerId = '00590000002QqfJ';
				//	$query = "SELECT Id, FirstName, LastName, PersonMobilePhone from Account where LastName='test'";
               // $response = $mySforceConnection->query($query);
				 $response = $mySforceConnection->create($records, 'Account');
				 Print_r($response);
				/* if(!$response)
				 {
					 echo"vcbgvbvg";
				 }
				Print_r($response);
exit;
              /*  $ids = array();
                foreach ($response as $i => $result) {
                   // echo ($result->success == 1) 
                         //   ? $records[$i]->FirstName." ".$records[$i]->LastName
                          //      ." ".$records[$i]->PersonMobilePhone." created with id "
                            //    .$result->id."<br/>\n"
                         //   : "Error: ".$result->errors->message."<br/>\n";
                    array_push($ids, $result->id);
					//Print_r($response);
				   
				  // Exit;
                }*/
			}catch (Exception $e) {
				
    
}
		
			?>
        </tt>
    </body>
</html>

In my salesforce Lastname mobileno,city are mandatory field. How to throw the error based on mandatory field. 2nd once is how to check the mobile no is already exist or not.

Now,After submit the form it throw the Error from the validation rule (If the mobile is exist means, It throw the error duplicate mobile no). But i want to Before submit form i need to check all.

1.Name,City,Email,Mobile is Mandatory
2.Check the Mobile is already exist or not. Exist means throw the error like "Mobile no already exist". How to do it????
Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello UmaDevi,

Please find the attched PHP code. It will check whether the phone number exists in salesforce or not. If exists, then it will throw an error message. 
<?php
    
	$username="USERNAME";
	$pwd="PASSWORD";
	$st="";
    $i=0;
	try{
		require_once('soapclient/SforcePartnerClient.php');
		$mySforceConnection = new SforcePartnerClient();
		$mySforceConnection->createConnection("Partner.wsdl.xml");
		$mySforceConnection->login($username, $pwd.$st);
		//Checking no exception is thrown
		$i=1;
	}	
	catch(Exception $e){
		echo $e;
	}
    
    // On Click of the insert button
	if(@$_REQUEST['OK']) {

    //First check for validation
	if($_REQUEST['name'] == null || $_REQUEST['name'] == '') {
		echo "First Name can't be blank";	
	} else if($_REQUEST['lastName'] == null || $_REQUEST['lastName'] == '') {
		echo "Last Name can't be blank";	
	} else if($_REQUEST['email'] == null || $_REQUEST['email'] == '') {
		echo "Email can't be blank";	
	} else {
		// Checking no exception is iccured during login
		if($i==1) {
			 try {
			 	// Checking whether Phone number exists in salesforce or not?
				$query = "SELECT Id,Name from Contact where Phone='".$_REQUEST['mobNo']."'";
				$response = $mySforceConnection->query($query);
				$count=0;
				foreach ($response->records as $record) {
					$count++;
					break;
				}
				// if count is greater than 0, this means phone alredy exists
				if($count > 0) {
					echo "Phone no. already exists";
				} else {
					$fields = array (
					    'FirstName' => $_REQUEST['name'],
					    'LastName' => $_REQUEST['lastName'],
					    'Phone' => $_REQUEST['mobNo'],
					    'Email' => $_REQUEST['email'],
			    	);
					$sObject = new SObject();
					$sObject->fields = $fields;
					$sObject->type = 'Contact';
					$createResponse = $mySforceConnection->create(array($sObject));

					echo '<div style=" background:#00FF00;height:25px;><font size="4"><center><b>'."Contact Inserted Successfully".'</b>  
												 </center></font></div>';
				}

			 } catch(Exception $e){
			 	echo $e;
			 }	 	
		} else {
			echo "Wrong UserName, password or Security Token.";
	    }
	}
}
?>
<html>
<title>
SalesForce - PHP Integration
</title>
<body bgcolor="#CCFFFF">
<form name="form3" method="post">
<div style="background:#9999FF; color:#000000; height:30px; vertical-align:middle; font-size:22px; font-weight:bold"><center> Insert Contact</center></div><br />
<table align="center">      <tr>
                      <td><b>First Name</b></td>
                      <td><input type="text" name="name" id="name" size="25"></td>
                   </tr>
				   <tr>
                      <td><b>Last Name</b></td>
                      <td><input type="text" name="lastName" id="lastName" size="25"></td>
                   </tr>
                   <tr>
                      <td><b>Mobile No.</b></td>
                      <td><input type="text" name="mobNo" id="mobNo" size="25"></td>
                   </tr>
				   <tr>
                      <td><b>Email</b></td>
                      <td><input type="text" name="email" id="email" size="25"></td>
                   </tr>
                   	<tr>
                      <td colspan="2"><center><input type="submit" value="Insert" name="OK"></center></td>
                  </tr>
				  
</table>
</form>
</body>
</html>

Save tis file as yourFileName.php. 

Pre-requisits -
1) PHP tool-Kit
2) Place this file in the same folder where you have put "soapclient" and partner WSDL, like this -
User-added image

Pls, let me konw, if you need further help.


Thanks, 
Sumit kumar Singh
 
Sakthi169Sakthi169
Hi Sumit,

I got Following Error:

Warning: Missing argument 2 for SforceEnterpriseClient::create(), called in C:\xampp\htdocs\salesforce.php on line 57 and defined in C:\xampp\htdocs\soapclient\SforceEnterpriseClient.phpon line 52

Notice: Undefined variable: type in C:\xampp\htdocs\soapclient\SforceEnterpriseClient.php on line 63
SoapFault exception: [sf:INVALID_TYPE] INVALID_TYPE: Must send a concrete entity type. in C:\xampp\htdocs\soapclient\SforceBaseClient.php:499 Stack trace: #0 C:\xampp\htdocs\soapclient\SforceBaseClient.php(499): SoapClient->__call('create', Array) #1 C:\xampp\htdocs\soapclient\SforceBaseClient.php(499): SoapClient->create(Object(SoapParam)) #2 C:\xampp\htdocs\soapclient\SforceEnterpriseClient.php(73): SforceBaseClient->_create(Object(SoapParam)) #3 C:\xampp\htdocs\salesforce.php(57): SforceEnterpriseClient->create(Array) #4 {main}
Sakthi169Sakthi169
I mention in my code "enterprise WSDL".I dont have skype id. can u tel me change???
Sakthi169Sakthi169
I insert the value into "Account" page not in "Contact"
Sumit Kumar Singh 9Sumit Kumar Singh 9
You can change 
 $sObject->type = 'Contact'; to account, and the relavant fields.
I don't have worked on enterprise WSDL so can't really help you on this.

Thanks
Sumit
Sakthi169Sakthi169
Hello Sumit,

In my code it was working fine i need to show if the mobile no is already exist means just throw the message. that's it. Can you help for this??
 
Sumit Kumar Singh 9Sumit Kumar Singh 9
You can try this - 
<?php
// session_start() has to go right at the top, before any output!
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>REST/OAuth Example</title>
    </head>
    <body>
        <tt>
            <?php

            require_once ('soapclient/SforcePartnerClient.php');
            require_once ('soapclient/SforceEnterpriseClient.php');

            define("USERNAME", "xxxxxxx");
            define("PASSWORD", "xxxxxx");
            define("SECURITY_TOKEN", "xxxxxxx");
			$First=$_POST['fname'];
			$Last=$_POST['lname'];
			$PersonMobilePhone=$_POST['mobile'];
			$Email=$_POST['u_email'];
			//$Landline=$_POST['landline'];
			//Print_r($_POST);
			//exit;

            try {
                //echo "<table border=\"1\"><tr><td>";
               // echo "First with the enterprise client<br/><br/>\n";

                $mySforceConnection = new SforceEnterpriseClient();
                $mySforceConnection->createConnection("soapclient/enterprise.wsdl.xml");
				$mySforceConnection->setEndpoint('https://test.salesforce.com/services/Soap/c/36.0/0DFO000000001Oi');

               if (isset($_SESSION['enterpriseSessionId'])) {
                    $location = $_SESSION['enterpriseLocation'];
                    $sessionId = $_SESSION['enterpriseSessionId'];

                    $mySforceConnection->setEndpoint($location);
                    $mySforceConnection->setSessionHeader($sessionId);

                    //echo "Used session ID for enterprise<br/><br/>\n";
                } else {
                    $mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);

                    $_SESSION['enterpriseLocation'] = $mySforceConnection->getLocation();
                    $_SESSION['enterpriseSessionId'] = $mySforceConnection->getSessionId();

                   // echo "Logged in with enterprise<br/><br/>\n";
                }
				//echo "<br/>Now, create some records<br/><br/>\n";
				//////////////////////////////////////////////////////////////////////////////////////////
				// Here we are retrieving the record based on the condition "where PersonMobilePhone='".$PersonMobilePhone."'"", You can change it whatever you want.
////////////////////////////////////////////////////////////////////////////////////////////////////////////
				$query = "SELECT Id, FirstName, LastName, PersonMobilePhone from Account where PersonMobilePhone='".$PersonMobilePhone."'";
				$response = $mySforceConnection->query($query);
				$count=0;
                foreach ($response->records as $record) {
                    $count++;
                    break;
                }
                // if count is greater than 0, this means phone alredy exists
                if($count > 0) {
                    echo "Phone no. already exists";
			    } else {
				//Phone no. doesn't exist create the record.
				$records = array();
                $records[0] = new stdclass();
                $records[0]->FirstName = $_POST['fname'];
                $records[0]->LastName = $_POST['lname'];
                $records[0]->PersonMobilePhone = $PersonMobilePhone;
				$records[0]->CustomLandLine__c = '';
				$records[0]->City__c = 'Mumbai';
				$records[0]->Source__c = 'Database';
					$records[0]->OwnerId = '00590000002QqfJ';
				//	$query = "SELECT Id, FirstName, LastName, PersonMobilePhone from Account where LastName='test'";
               // $response = $mySforceConnection->query($query);
				 $response = $mySforceConnection->create($records, 'Account');
				 Print_r($response);
				/* if(!$response)
				 {
					 echo"vcbgvbvg";
				 }
				Print_r($response);
exit;
              /*  $ids = array();
                foreach ($response as $i => $result) {
                   // echo ($result->success == 1) 
                         //   ? $records[$i]->FirstName." ".$records[$i]->LastName
                          //      ." ".$records[$i]->PersonMobilePhone." created with id "
                            //    .$result->id."<br/>\n"
                         //   : "Error: ".$result->errors->message."<br/>\n";
                    array_push($ids, $result->id);
					//Print_r($response);
				   
				  // Exit;
                }*/
				}

				
				
                
			}catch (Exception $e) {
				
    
}
		
			?>
        </tt>
    </body>
</html>
Hope, this helps you.

Thanks, 
Sumit Kumar Singh
This was selected as the best answer
Sakthi169Sakthi169
Hi Sumit,

Thanks it was working fine.But I change it single form and my code
<?php
// session_start() has to go right at the top, before any output!
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
    </head>
    <body bgcolor="#CCFFFF">
      
            <?php

            require_once ('soapclient/SforcePartnerClient.php');
            require_once ('soapclient/SforceEnterpriseClient.php');

            define("USERNAME", "xxxxxxxxxx");
            define("PASSWORD", "xxxxxxx");
            define("SECURITY_TOKEN", "xxxxx");
			//$First=$_POST['name'];
			//$Last=$_POST['lastName'];
			//$PersonMobilePhone=$_POST['mobNo'];
			//$Email=$_POST['email'];
			//$Landline=$_POST['landline'];
			//Print_r($_POST);
			//exit;
			$i=0;

            try {
                //echo "<table border=\"1\"><tr><td>";
               // echo "First with the enterprise client<br/><br/>\n";

                $mySforceConnection = new SforceEnterpriseClient();
                $mySforceConnection->createConnection("soapclient/enterprise.wsdl.xml");
				$mySforceConnection->setEndpoint('https://test.salesforce.com/services/Soap/c/36.0/0DFO000000001Oi');

               if (isset($_SESSION['enterpriseSessionId'])) {
                    $location = $_SESSION['enterpriseLocation'];
                    $sessionId = $_SESSION['enterpriseSessionId'];

                    $mySforceConnection->setEndpoint($location);
                    $mySforceConnection->setSessionHeader($sessionId);

                    //echo "Used session ID for enterprise<br/><br/>\n";
                } else {
                    $mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);

                    $_SESSION['enterpriseLocation'] = $mySforceConnection->getLocation();
                    $_SESSION['enterpriseSessionId'] = $mySforceConnection->getSessionId();

                   // echo "Logged in with enterprise<br/><br/>\n";
                }
				//echo "<br/>Now, create some records<br/><br/>\n";
				if(@$_REQUEST['OK']) {

    //First check for validation
	if($_REQUEST['name'] == null || $_REQUEST['name'] == '') {
		echo "First Name can't be blank";	
	} else if($_REQUEST['lastName'] == null || $_REQUEST['lastName'] == '') {
		echo "Last Name can't be blank";	
	} else if($_REQUEST['email'] == null || $_REQUEST['email'] == '') {
		echo "Email can't be blank";	
	}/*else {
		// Checking no exception is iccured during login
		if($i==1) {
			 try {
			 	// Checking whether Phone number exists in salesforce or not?
				$query = "SELECT Id,LastName from Account where PersonMobilePhone='".$_REQUEST['mobNo']."'";
				Print_r($query);
				Exit;
				$response = $mySforceConnection->query($query);
				$count=0;
				foreach ($response->records as $record) {
					$count++;
					break;
				}
				// if count is greater than 0, this means phone alredy exists
				if($count > 0) {
					echo "Phone no. already exists";
				} else {
					/*$fields = array (
					    'FirstName' => $_REQUEST['name'],
					    'LastName' => $_REQUEST['lastName'],
					    'PersonMobilePhone' => $_REQUEST['mobNo'],
					    'PersonEmail' => $_REQUEST['email'],
			    	);
					$sObject = new SObject();
					$sObject->fields = $fields;
					$sObject->type = 'Account';
					$createResponse = $mySforceConnection->create(array($sObject));*/
					$records = array();

                $records[0] = new stdclass();
                $records[0]->FirstName = $_REQUEST['name'];
                $records[0]->LastName = $_REQUEST['lastName'];
                $records[0]->PersonMobilePhone = $_REQUEST['mobNo'];
				$records[0]->CustomLandLine__c = '';
				$records[0]->City__c = 'Mumbai';
				$records[0]->Source__c = 'Database';
					$records[0]->OwnerId = '00590000002QqfJ';
					 $response = $mySforceConnection->create($records, 'Account');
				 //Print_r($response);

					
												 $ids = array();
				 foreach ($response as $i => $result) {
                   echo ($result->success == 1) 
                           ? "Success: Lead Inserted Successfully<br/>\n"
                          : "Error: Mobile No is already Exist<br/>\n";
                    array_push($ids, $result->id);
					
					//Print_r($response);
				   
				  // Exit;
                }
				}

			 } catch(Exception $e){
			 	echo $e;
			 }	 	
		
?>
   
<title>
SalesForce - PHP Integration
</title>

<form name="form3" method="post">
<div style="background:#9999FF; color:#000000; height:30px; vertical-align:middle; font-size:22px; font-weight:bold"><center> Insert Lead</center></div><br />
<table align="center">      <tr>
                      <td><b>First Name</b></td>
                      <td><input type="text" name="name" id="name" size="25"></td>
                   </tr>
				   <tr>
                      <td><b>Last Name</b></td>
                      <td><input type="text" name="lastName" id="lastName" size="25"></td>
                   </tr>
                   <tr>
                      <td><b>Mobile No.</b></td>
                      <td><input type="text" name="mobNo" id="mobNo" size="25"></td>
                   </tr>
				   <tr>
                      <td><b>Email</b></td>
                      <td><input type="text" name="email" id="email" size="25"></td>
                   </tr>
                   	<tr>
                      <td colspan="2"><center><input type="submit" value="Insert" name="OK"></center></td>
                  </tr>
				  
</table>
</form>
</body>
</html>

I put validation for first name,Lastname,Email.When click submit without put any value....It shows the error message like "First Name can't be blankError: Mobile No is already Exist".
how to check step by step. 1st Firstname,lastname,Email,Mobile is not empty based on variable i put the error message,then only if mobile no is exist show the second message. I tried but it shows the above error message. How to do it ????
Sakthi169Sakthi169
Hi Sumit,

I change simple things and working fine.... Thank u so much
 
Sakthi169Sakthi169
Hi Sumit,
Once i submit form and reload the page it shows the "Mobile Number exist message". How to avoid the re-submit the page for reloading