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) »
  • Activity "get" API is not retrieving custom data, target or assignee
Pages: [1]

Author Topic: Activity "get" API is not retrieving custom data, target or assignee  (Read 1134 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Activity "get" API is not retrieving custom data, target or assignee
June 21, 2013, 08:02:35 pm
I am currently using the Activity API to get a single activity by id.  However, none of the custom data on the record, activity assignees or activity targets are being returned.  How can I force the Activity "get" API to return these extra fields?
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Activity "get" API is not retrieving custom data, target or assignee
June 21, 2013, 09:10:07 pm
There are some syntax examples in the examples folder

https://github.com/civicrm/civicrm-core/tree/master/api/v3/examples/Activity
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Activity "get" API is not retrieving custom data, target or assignee
June 21, 2013, 09:18:14 pm
Base on the examples, I updated my code. The current call is:
cj().crmAPI ('Activity','get',{ 'sequential' :'1', 'return.assignee_contact_id': '1', 'return.target_contact_id': '1', 'activity_id' :act_id}   etc.

But I am still not getting the assignees or the targets
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Activity "get" API is not retrieving custom data, target or assignee
June 21, 2013, 11:08:03 pm
The new syntax is CRM.api()

in js, the syntax for return (works as well in php) is &return=assignee_contact_id,target_contact_id...

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Activity "get" API is not retrieving custom data, target or assignee
June 22, 2013, 12:37:56 am
X - I think epg is on 4.2 & you might be setting him wrong. Also, those return params are 'magic' params - I'm not sure if they work in the normal 'return' field or not - although they have been patched a bit in 4.3 or 4.4 I think
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Activity "get" API is not retrieving custom data, target or assignee
June 22, 2013, 08:05:24 am
I am using version 4.2.7
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Activity "get" API is not retrieving custom data, target or assignee
June 22, 2013, 10:38:33 am
return should work with cj.crmAPI too.

but I'd suggest to upgrade to 4.3 if you can


X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Activity "get" API is not retrieving custom data, target or assignee

This forum was archived on 2017-11-26.