2010-06-17 108 views
2

我試圖在展望列表(目標列表)和聯繫人之間創建關係。聯繫人與展望列表之間的SugarCRM SOAP set_relationship錯誤

我創建了一個新的聯繫人,並使用我創建的類來獲取潛在客戶列表的ID,這些類只是soap提供的soap api調用的包裝器。 但代碼歸結爲SOAP調用:

$this->_sugarsoap->client->__soapCall('set_relationship', array($this->getSessionid(),$relationship)); 

$這個 - > getSessionid()是會話ID和$關係是保持這樣的數組:我嘗試在此之後

array 
    0 => string 'ProspectLists' (length=13) 
    1 => string '180ab1f5-cf7e-d386-50f8-4c18a790e016' (length=36) 
    2 => string 'Contacts' (length=8) 
    3 => string '76323942-8cbb-3224-f18a-4c19efa80a1b' (length=36) 

我總是得到這樣的錯誤:(我做的SOAP調用的返回值的的var_dump)

object(stdClass)[5] 
    public 'number' => string '20' (length=2) 
    public 'name' => string 'Module Does Not Exist' (length=21) 
    public 'description' => string 'This module is not available on this server' (length=43) 

這似乎是一個錯誤的SugarCRM,因爲我有聯繫人模塊,也是前景利sts模塊。我知道這是事實,因爲我通過soap調用添加了一個聯繫人,並通過soap調用來檢索潛在客戶列表的id。

我發現this thread在糖論壇上,我確實嘗試了在那裏給出的代碼,但我仍然有同樣的錯誤。

任何人都有解決方案嗎?我真的需要通過肥皂呼叫將聯繫人關聯到預期列表(目標列表)。

我在使用mysql的ubuntu服務器上使用SugarCRM 5.5.0(我也試過用sugarcrm 5.5.2並得到相同的錯誤)。

謝謝!

編輯:

好,我得到這個從螺紋的修復和對我而言有點校正工作。在我傳遞給set_relantionships功能的陣列我真的要使用的格式:

'module1' => 'modnameA', 
'module1_id' => 'modidA', 
'module2' => 'modnameB', 
'module2_id' => 'modidB 

希望這可以幫助別人:)

+1

嗨,你能幫助我,根據API文檔的set_relationship(沒有s)是接收字符串,而不是散列名稱 - 密鑰對....什麼是正確的格式傳遞到set_relationship ()? – Angela 2010-08-07 19:42:20

+0

好吧我試過這個 - 不匹配api的,但移動 - 但我得到一個模塊不存在的錯誤!? – Angela 2010-08-07 20:05:29

+0

嘿安吉拉!我在這裏使用舊的soap api!新的用於糖的soap文件在services/v2中(或類似的東西)。新的肥皂類是一個更復雜的方法,但它比舊的肥皂好多了:) – AntonioCS 2010-08-09 08:48:58

回答

0

下面是代碼,將肯定幫助您:

$relationship = array(
    'session' => $session_id, //session id that comes after login by soap 
    'set_relationship_value'=>array(
    'module1' => 'Prospect', // your module name 
    'module1_id' => "$ProspectID", // your first module id 
    'module2' => 'Contact', // your second module 
    'module2_id' => "$ContactId", // send module id 
) 
); 

使用此數組。希望這會對你有所幫助。

相關問題