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) »
  • phone api
Pages: [1]

Author Topic: phone api  (Read 730 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
phone api
March 25, 2011, 02:37:01 pm
Hi,

Just used apiv3_phone & found that when I passed in location_type_id & phone_type_id the existing phone number was updated,

Is there an option to add rather than update (e.g. 2 personal mobile numbers). Perhaps $params['add_new']?
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

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: phone api
March 25, 2011, 04:04:33 pm
Or simply that if you have params[id] that's an update, otherwise always an add ?

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: phone api
March 25, 2011, 04:09:15 pm
Yeah, it seems like a fairly useful exception to that behaviour though- ie. I expect the api to be able to update a phone no in one call. Dunno

NB adding extra fields  to the documentation - I don't want to overwrite 'getFields' - I just want to add one - can I do that without having to replicate the main getFields stuff in a custom function?
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

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: phone api
March 25, 2011, 10:59:21 pm
Bit of refactoring then:

the code (line 56 to get the fields is inside civicrm_api, move it outside into a _civicrm_api3_getfield that returns the d->fields

call it from civicrm_api and from your civicrm_api3_phone_getfields

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: phone api
March 26, 2011, 04:15:48 am
BTW - phone api is MUCH faster than v2 location was
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]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • phone api

This forum was archived on 2017-11-26.