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.




$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);
} catch (Exception $e) {



object(stdClass)#4 (3) {
string(2) "20"
string(21) "Module Does Not Exist"
string(43) "This module is not available on this server"

What is the problem?