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) »
  • API no limit in 4.2.4
Pages: [1]

Author Topic: API no limit in 4.2.4  (Read 723 times)

ThomWilhelm

  • I’m new here
  • *
  • Posts: 10
  • Karma: 2
  • CiviCRM version: 4.2
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5
API no limit in 4.2.4
November 02, 2012, 06:14:10 am
Having upgraded to CiviCRM 4.2.4, I previously used the following API call in 4.1.1 to load all phone numbers for a given ID, otherwise I'd be limited to just loading 25 records:

$param = array(
   "version" => 3,
   "contact_id" => $objectId,
   "rowCount" => 0
);
$result = civicrm_api("Phone", "Get", $param);


However rowCount now seems to be replaced by option.limit, however setting this option to 0 or -1 doesn't give me no limit, it instead does just limit to no rows or throws an error.

$param = array(
   "version" => 3,
   "contact_id" => $objectId,
   "option.limit" => 0
);
$result = civicrm_api("Phone", "Get", $param);


For now I am just setting option.limit to an arbitrarily high number (1000), but I'd just like to ask if there is still a no limit option in the API.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: API no limit in 4.2.4
November 02, 2012, 06:51:18 am
Hi,

To be sure I understand: you have contacts with more than 25 phones, right?

That shouldn't have happened that rowCount=0 worked, bit of no too much planned ;)

Good point about options.limit=-0 or 0, will check
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

ThomWilhelm

  • I’m new here
  • *
  • Posts: 10
  • Karma: 2
  • CiviCRM version: 4.2
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5
Re: API no limit in 4.2.4
November 02, 2012, 08:35:08 am
No I don't have any contacts with more than 25 phones, so it doesn't really matter if I leave it out in this case. However I still think it would be nice if "options.limit" equal to 0 or -1 gave no limit as a standard in the API.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • API no limit in 4.2.4

This forum was archived on 2017-11-26.