You need to sign in to do that
Don't have an account?
Sakthi169
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????
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????
Thanks,
Sumit Kumar Singh
All Answers
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
This is my simple form
And my PHP Page is like this
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????
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.
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 -
Pls, let me konw, if you need further help.
Thanks,
Sumit kumar Singh
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}
$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
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??
Thanks,
Sumit Kumar Singh
Thanks it was working fine.But I change it single form and my code
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 ????
I change simple things and working fine.... Thank u so much
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