get salesforce data

WE HAVE MOVED!

Please visit our new Drupal Website at https://www.xenyo.com我們的新網頁設計公司網頁.

/*  
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='[email protected]' AND LeadSource='something'";
$data = _get_data($query);
$name = $data[0]['Name'];
print $name;
Help Share this Article