get salesforce data

/*  
require enable salesforce.module
*/
 
//custom function
function _get_data($queryString){
	$sfapi = rfg_salesforce_api_connect();		
 
	$results = $sfapi->query(urlencode($queryString));  
 
	$data = array();	
	foreach($results['records'] as $record){
			$data[] = $record;
	}	
return $data;
}
 
//get client name on Lead
$query = "SELECT Name FROM Lead WHERE Email='client@something.com' AND LeadSource='something'";
$data = _get_data($query);
$name = $data[0]['Name'];
print $name;
Help Share this Article