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) »
  • Trying to get activity types for contact component only
Pages: 1 [2]

Author Topic: Trying to get activity types for contact component only  (Read 3157 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
Re: Trying to get activity types for contact component only
June 14, 2013, 03:33:08 am
Quote from: xavier on June 14, 2013, 02:22:02 am

Was this that painful ? ;)



Nope - actually it was very useful !

Thank you for the info!

I tried this:

/civicrm/ajax/rest?entity=OptionValue&action=get&debug=1&sequential=1&json=1&option_group_name=activity_type

and I get good results but I also get:

"undefined_fields":["option_group_name","option_group_id"],
« Last Edit: June 14, 2013, 03:35:17 am by nant »
--
Nick (aka nant from CB Team)

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
Re: Trying to get activity types for contact component only
June 15, 2013, 12:33:04 am
Status report:

When I use:

$params = array(
  'version' => 3,
);
$result = civicrm_api('ActivityType', 'get', $params);

I get a 50 count returned.

If I use:

$params = array(
  'version' => 3,
  'option_group_name' => 'activity_type',
);
$result = civicrm_api('OptionValue', 'get', $params);

I get a 25 count returned.

Why the difference?
Which activities are being filtered and why?
« Last Edit: June 15, 2013, 12:37:47 am by nant »
--
Nick (aka nant from CB Team)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Trying to get activity types for contact component only
June 15, 2013, 02:33:13 am
By default, it limits to 25 entities.

options.limit=xxx is the param to define how much you want (or option.limit, never remember)
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

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
Re: Trying to get activity types for contact component only
June 15, 2013, 07:16:02 am
Quote from: xavier on June 15, 2013, 02:33:13 am
By default, it limits to 25 entities.

options.limit=xxx is the param to define how much you want (or option.limit, never remember)

Thank you!

It is option.limit (no -s).

Is there a way to specify no limit?
I tried using 0 but it does not work.

BTW - I have released version 1.0 of the plugin here:
http://civicrm.org/extensions/joomla-2-civicrm-user-synchronization

It is free ofc and can be downloaded by everyone (no registration needed).
--
Nick (aka nant from CB Team)

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
Re: Trying to get activity types for contact component only
June 15, 2013, 07:57:22 am
Quote from: xavier on June 15, 2013, 02:33:13 am
By default, it limits to 25 entities.

options.limit=xxx is the param to define how much you want (or option.limit, never remember)

Is there a way to filter for only entries that have component_id set ?
--
Nick (aka nant from CB Team)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Trying to get activity types for contact component only
June 15, 2013, 09:34:06 am
Don't think so, filter in php once you have called it
-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: Trying to get activity types for contact component only
August 14, 2013, 06:31:24 pm
On an api like option_value (DAO based) its worth trying

$params['component_id' => array('Not Null');

I think that's it - look in the Option Value folder in the examples dir
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

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Trying to get activity types for contact component only

This forum was archived on 2017-11-26.