amusarra
1/27/2015 - 11:16 AM

Add Contacts To ProspectList

Add Contacts To ProspectList

require_once('modules/ProspectLists/ProspectList.php');
$rel_name = 'contacts';
$contact_id = 'id_of_contact_to_link from $bean object';
$prospectList_id = 'id_of_prospect_to_affect';

$prospectList = new ProspectList();

 //Load a specific opportunity
$prospectList->retrieve($prospectList_id);
$prospectList->load_relationship($rel_name);

//Note use of $rel_name
$prospectList->$rel_name->add($contact_id); 
$prospectList->save()