AnsweredAssumed Answered

How to add an opportunity to an existing lead?

Question asked by alain calvillo on Feb 7, 2017
Latest reply on Feb 10, 2017 by Hemant Patil

Im trying to add an opportunity, possibly more than one, to an existing lead. I have the lead id already stored in a database table. After I successfully create an opportunity, I am attempting to add that opportunity to the lead. This is my code, but it does not seem to be working. I am using php's soap library to do this.

 

code:

 

$call_arguments = array(
    'session' => $session_id,
    'module_name' => 'Opportunities',
    'module_id' => $opp_id,
    'link_field_name' => 'leads',
    'related_ids' => array($lead_id),
    // 'name_value_list' => array(),
    'delete' => 0,
);


try {
    $result = $client->__soapCall('set_relationship', $call_arguments);
    var_dump($result);
} catch (Exception $e) {
    var_dump($e);
}

 

output:

object(stdClass)#4 (3) {
["number"]=>
string(2) "20"
["name"]=>
string(21) "Module Does Not Exist"
["description"]=>
string(43) "This module is not available on this server"
}

What is the problem? 

Outcomes