function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mike @ PartnersMike @ Partners 

Salesforce as Website data base

I am looking to use our salesforce data base as our websites data base as well. I am hoping to use it so clients can log-in at our website, and then access other pasts of the site. Does anyone have a sugetion on the best way to haddle this?

Thank you for your help
Park Walker (TAGL)Park Walker (TAGL)
I currently have clients who validate registered users against the Salesforce database and track their site activity in Salesforce. I'm wondering about what else you might want to use the Salesforce database for with regards to your web site. While it could be used as a CMS-type repository, there are probably a number of reason why that would not be a good idea. Can you elaborate a bit on your intentions?


ira42ira42

Redsummit wrote:
I currently have clients who validate registered users against the Salesforce database and track their site activity in Salesforce.








Hi there, I'm currently building a site for a client. The site is using Joomla, and open source CMS, for the main site, and they are currently using Salesforce for leads gathering.

For their old site, the SF integration was a simple one-way process, using the SF web-to-leads form for some sign-up forms. However for the new site I'm developing they've asked me to authenticate the web users against the data in Salesforce. I'm a designer and not a programmer, so I've been search the Salesforce site for days to see were to start. Most of the SF pages and video tutorials say how easy it is to authenticate users, however I'm just not finding a definitive answer on how to do this. I've called around for some quotes from developers, and have received quotes for thousands of dollars! Is it really that complicated? There MUST be an existing solution, I just don't know what to look for.

Please, if you could point me in the right direction on how to implement user authetication, I would appreciate it, tx!

Ira

ps... Here are some specs:

Web site is built using Joomla CMS
Apache server, with PHP 4.4.4, MySQL DB for user tables
Salesforce, professional ed.
Mike @ PartnersMike @ Partners

Ira,

It actually is very easy. The first thing you will need to do is get the lattes version of the php, and activate 'soap' (use this in the php.ini file "soap.wsdl_cache_enabled = 1") on the php. Then you will need to download the PHP tool kit that salesforce provides. With this tool kit you can make calls to salesforce database. Here is a vary simpple example of a call to our database. It is checking to see if a lead in our database already has the provided email.


Code:
<—php
include ('header.inc');
require_once ('../../salesforce/soapclient/SforcePartnerClient.php');
require_once ('../../salesforce/soapclient/SforceHeaderOptions.php');
$Email = $_POST['Email'];

session_start();

$mySforceConnection;
$myUserInfo;

function displayWelcome() {
$location = $_SESSION['location'];
$sessionId = $_SESSION['sessionId'];
$wsdl = $_SESSION['wsdl'];

global $myUserInfo;
global $mySforceConnection;

try {
$mySforceConnection = new SforcePartnerClient();
$sforceSoapClient = $mySforceConnection->createConnection($wsdl);
$mySforceConnection->setSessionHeader($sessionId);
$mySforceConnection->setEndpoint($location);
$servertime = $mySforceConnection->getServerTimestamp();
$myUserInfo = $mySforceConnection->getUserInfo();
} catch (exception $e) {
exit ();
}
}

//this function does the actual search in salesforce
function getleadQ() {
global $mySforceConnection;
$Email = $_POST['Email'];
$query = "SELECT Id from Lead where Lead.Email='$Email'";
$queryOptions = new QueryOptions(25);
$response = $mySforceConnection->query(($query), $queryOptions);
return $response->records;
}

//this function puts the return information into a form that you can use
function getlead() {
global $mySforceConnection;
$id = getleadQ ();
if ($id){
try {
foreach ($id as $r) {
$r = new SObject($r);
$Idl = $r->Id;
print($Idl);
}
} catch (Exception $e) {
}
}
else $Idl = "";
return $Idl;
}

displayWelcome();
getlead();
$contactid = contactid();
include ('footer.inc');
–>

This code could easily be morphed to search for any field in the contacts or the leads and then return the information. Right now it is set up to search leads for a certain e-mail and return the id of the lead.

Hope this helps.
Mike




 



Mike LeachMike Leach
Here are some mistakes we made integrating Salesforce with web sites:

Performance. Using Salesforce API Connections in Transactions
It can take anywhere from 5-20 seconds to get a Salesforce API connection. You can cache the session in the web site, but will need some error checking and re-connection logic. Web sites should not use Salesforce like they would a local database. Keep relevant information close to the customer in the web site/portal and synchronize with Salesforce in the background.

Identity. Not managing the customer lifecyle.
The customer will lose their web site identity when the Lead is converted to a Contact. Web sites need to constantly check the IsConverted flag on Leads and take appropriate action.

The web site should de-duplicate Lead registrations.

Security. Insufficient Authentication
Hackers can masquerade as any Salesforce Lead by simply guessing email addresses. Best practice is to require at least an email address and password.


The Salesforce integration modules to the Passage Open Source Portal address these issues.