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) »
  • Can crm_fetch_contact() search 'additional email' fields?
Pages: [1]

Author Topic: Can crm_fetch_contact() search 'additional email' fields?  (Read 1901 times)

rob123

  • Guest
Can crm_fetch_contact() search 'additional email' fields?
February 20, 2008, 05:05:49 am
I need to return a contact(individual) id from an email address and have found crm_fetch_contact() does the job apart from 1 thing;

The email address passed over via param 'email' only seems to reference primary email addresses.

It seems you can't even search the 'another email' fields through the Advanced Search.

Is there an API function that will return a contact id by checking ALL email address fields?

Thanks
Rob

PS. CiviCRM 1.9

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Can crm_fetch_contact() search 'additional email' fields?
February 20, 2008, 02:03:42 pm

No there is no api function to do that in v1.9 (or v2.0)

In v2.0, you can write a custom search to do what you need. For v1.9, you'll need to write your own db query and use those results to do the needful

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

rob123

  • Guest
Re: Can crm_fetch_contact() search 'additional email' fields?
February 20, 2008, 02:45:58 pm
OK, thanks I will do.

Rather than hardcode access to the database from the beginning with username and password can you please give me a pointer to an existing way to connect and run a query. I'm currently adding code in SoapServer.php (outside the class block).

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Can crm_fetch_contact() search 'additional email' fields?
February 20, 2008, 03:44:15 pm

here are some examples that you can use:

http://forum.civicrm.org/index.php/topic,2225.0.html
http://forum.civicrm.org/index.php/topic,2051.msg10271.html#msg10271

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

rob123

  • Guest
Re: Can crm_fetch_contact() search 'additional email' fields?
February 21, 2008, 12:30:22 am
wonderful thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Can crm_fetch_contact() search 'additional email' fields?

This forum was archived on 2017-11-26.