1

私は SugarCRM 6.4.4 と php 5.3.10 を使用しており、ソープ コールを使用して連絡先をターゲット リストに追加しようとしています... ProspectList クラスを直接使用してみましたが、うまくいきません。連絡先を問題なく作成できるため、SOAP 呼び出しが通過していることはわかっていますが、連絡先とターゲット リスト (PropsectList) の間の関係を作成しようとすると問題が発生します。私は何を間違っていますか?

これが私が試したSOAP呼び出しです。「1350 行目の /data/servers/thesite.com/web/administrator/sales/soap/SoapSugarUsers.php の非オブジェクトでメンバー関数 add() を呼び出します」というエラーが表示されます。 .1350 行付近のコードは次のとおりです。

if (!empty($key)) {
    $mod->load_relationship($key);
    $mod->$key->add($module2_id);
    return $error->get_soap_array();
}

SOAP の完全なコードは次のとおりです。

// set up options array
$options = array(
        "location" => 'http://www.thesite.com/sales/soap.php',
        "uri" => 'http://www.sugarcrm.com/sugarcrm',
        "trace" => 1
        );

//user authentication array
$user_auth = array(
"user_name" => 'theuser',
"password" => MD5('thepass'),
"version" => '.01'
);

// connect to soap server
$client = new SoapClient(NULL, $options);

// Login to SugarCRM
$response = $client->login($user_auth,'test');

$session_id = $response->id;

$user_id = $client->get_user_id($session_id);


//Add Contact to SugarCRM
$response = $client->set_entry($session_id, 'Contacts', array(
array('name' => 'first_name','value' => 'roneFirst2'),
array('name' => 'last_name','value' => 'roneLast2'),
array('name' => 'account_name','value' => 'jdam Props'),
array('name' => 'email1','value' => 'roneEmail2@gmail.com'),
array('name' => 'work_phone','value' => '1.888.888.8888'),
array('name' => 'description','value' => 'This is the message'),
array('name' => 'assigned_user_id','value' => $user_id)
));
$contact_id = $response->id;


//Add Contact to TARGET LIST
$relationship = array(
'module1' => 'Contacts',
'module1_id' => "$contact_id",
'module2' => 'ProspectLists',
'module2_id' => "24053784-f8d3-22a4-5e99-4fc6a7d5159f"  //Note: this id was pulled from the table in the database directly for the target list we want to link the contact with.
);

//call set_relationship()
$response = $client->set_relationship($session_id, $relationship);

グーグルで検索して、これを3日間理解しようとしています...あなたが喜んで提供してくれてありがとう。

4

0 に答える 0