SugarCRM soap call not linking contact to a target list -
i'm using sugarcrm 6.4.4 , php 5.3.10 , trying add contact target list using soap call...i've tried using prospectlist class directly can't work. know soap calls getting through because can create contact fine, problem coming when try create relationship between contact , target list (propsectlist). doing wrong?
here's soap call tried. i'm getting error says: "call member function add() on non-object in /data/servers/thesite.com/web/administrator/sales/soap/soapsugarusers.php on line 1350"...here's code around line 1350
if (!empty($key)) { $mod->load_relationship($key); $mod->$key->add($module2_id); return $error->get_soap_array(); } here's full code soap:
// set 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 soap server $client = new soapclient(null, $options); // login sugarcrm $response = $client->login($user_auth,'test'); $session_id = $response->id; $user_id = $client->get_user_id($session_id); //add contact 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 message'), array('name' => 'assigned_user_id','value' => $user_id) )); $contact_id = $response->id; //add contact target list $relationship = array( 'module1' => 'contacts', 'module1_id' => "$contact_id", 'module2' => 'prospectlists', 'module2_id' => "24053784-f8d3-22a4-5e99-4fc6a7d5159f" //note: id pulled table in database directly target list want link contact with. ); //call set_relationship() $response = $client->set_relationship($session_id, $relationship); been googleing , trying figure out 3 days now...thanks willing give.
Comments
Post a Comment