2014-10-29 68 views
0

我正在使用salesforce Enterprise API在salesforce中添加銷售線索。如何檢索salesforce的所有領域?

$SFDCUSERNAME = "myusername"; 
    $SFDCPASSWORD = "mypassword!"; 
    $SFDCSECURITY_TOKEN = "mytoken"; 
    $SFDCCLIENT = "soapclient/SforceEnterpriseClient.php"; 
    $SFDCWSDL = "soapclient/enterprise.wsdl.xml"; 

require_once($SFDCCLIENT); 

try { 
    $mySforceConnection = new SforceEnterpriseClient(); 
    $myConnection = $mySforceConnection->createConnection($SFDCWSDL); 
    $myLogin = $mySforceConnection->login($SFDCUSERNAME, $SFDCPASSWORD.$SFDCSECURITY_TOKEN); 


} 
catch(Exception $e) { 
    print_r($e); 
} 

我可以使用API​​創建線索。 現在我想找回這可用於鉛在Salesforce(不僅是自定義字段,而且缺省的/ in_built場)的所有領域,並顯示在一個HTML下拉場。

是否可以檢索使用Salesforce的API鉛所有領域?

回答

1

經過長時間的搜尋後,我得到了一個答案,它爲我工作。我在這裏發佈它,希望這可能對別人有所幫助。

try { 
     $mySforceConnection = new SforceEnterpriseClient(); 
     $myConnection = $mySforceConnection->createConnection($SFDCWSDL); 
     $myLogin = $mySforceConnection->login($SFDCUSERNAME, $SFDCPASSWORD.$SFDCSECURITY_TOKEN); 
     echo "<pre>"; 
     print_r($mySforceConnection->describeSObject('Lead')); 
     echo "</pre><br>";  

    } 
    catch(Exception $e) { 
     print_r($e); 
    } 

存在其中輸出關於包括字段細節的對象的完整細節銷售人員API describeSObject()的功能。

REFERENCE