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 (Moderator: Donald Lobo) »
  • API - Search Membership by custom field
Pages: [1]

Author Topic: API - Search Membership by custom field  (Read 1225 times)

rubofvil

  • I’m new here
  • *
  • Posts: 23
  • Karma: 1
  • CiviCRM version: 4.2.7
  • CMS version: Drupal 7
  • MySQL version: mysql 5.1
  • PHP version: php 5.2
API - Search Membership by custom field
May 30, 2013, 10:38:29 am
I'm trying to find Membership with criteria of one custom Field.

I see that in Contribution and Contact is it necessarily add param of custom field:

$results=civicrm_api("Contact","get", array (version=3','sequential' =>'1', 'custom_3' =>'123'));

But in Membership not work. Any solution?

http://wiki.civicrm.org/confluence/display/CRMDOC43/API+Reference#APIReference-Parameters
Testing : CiviCRM 4.2.7, 4.1.6

Thanks!!!
« Last Edit: May 30, 2013, 10:40:05 am by rubofvil »

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: API - Search Membership by custom field
May 30, 2013, 01:42:17 pm
Unfortunately the membership api calls a BAO function that doesn't do that filtering :-(

Contribution & Contact both call the query object - which does. It may be possible for membership to call that too - but it might need some work to make that change seamless.

Have you tried passing the membership custom field to the contribution or contact search? It might work?
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

rubofvil

  • I’m new here
  • *
  • Posts: 23
  • Karma: 1
  • CiviCRM version: 4.2.7
  • CMS version: Drupal 7
  • MySQL version: mysql 5.1
  • PHP version: php 5.2
Re: API - Search Membership by custom field
June 18, 2013, 04:15:03 am
Thank for your answer and sorry by late Reply.

We was thinking so much in this problem. ???

I need search by custom field because i will import "donor id"(membership id of other environment) in custom field, and it's necessary in any search's and process.

Finally i'm going to import this "donor id" in "external id" . Later we are going to update "internal membership ID" with "external id"(with any sql script).

Is a Good solution?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • API - Search Membership by custom field

This forum was archived on 2017-11-26.