CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • How to assign multiple contacts to a single activity
Pages: [1]

Author Topic: How to assign multiple contacts to a single activity  (Read 711 times)

nant

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 4
    • Joomlapolis
  • CiviCRM version: 4.3.4
  • CMS version: Joomla 2.5.11
  • MySQL version: 5
  • PHP version: 5.3
How to assign multiple contacts to a single activity
June 12, 2013, 08:19:52 am
I am using this sample code:

function activity__example(){
$params = array(
  'source_contact_id' => 17,
  'subject' => 'Make-it-Happen Meeting',
  'activity_date_time' => '20110316',
  'duration' => 120,
  'location' => 'Pensulvania',
  'details' => 'a test activity',
  'status_id' => 1,
  'activity_type_id' => 1,
  'version' => 3,
  'priority_id' => 1,
  'target_contact_id' => 17,
  'assignee_contact_id' => 22,
);

  $result = civicrm_api( 'activity','create',$params );

The activity is created just fine and assigned just fine to contact 22

Question is how can I assign the same activity to another contact?
--
Nick (aka nant from CB Team)

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: How to assign multiple contacts to a single activity
June 29, 2013, 01:55:56 am
For the 'assignee_contact_id', pass in an array of integers. The same should work with 'target_contact_id'.

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
Re: How to assign multiple contacts to a single activity
March 17, 2015, 12:08:32 am
thanks!

bring on stack overflow interface i say!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • How to assign multiple contacts to a single activity

This forum was archived on 2017-11-26.