Skip to content

Instantly share code, notes, and snippets.

@amusarra
Created January 27, 2015 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amusarra/844ab567edc25948ce00 to your computer and use it in GitHub Desktop.
Save amusarra/844ab567edc25948ce00 to your computer and use it in GitHub Desktop.
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment