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) »
  • Updating records by matching a field
Pages: [1]

Author Topic: Updating records by matching a field  (Read 841 times)

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Updating records by matching a field
August 31, 2013, 01:46:49 am
I had an API use-case which involved:

1. A list of pre-existing records in a Civi table (civicrm_word_replacement -- aka API entity "WordReplacement")
2. A list of new/updated records to go in the table -- but no ID#s.
3. A business-key I could use to match the new/updated info with the existing info. (The business-key was "domain_id+find_word".)

This would ordinarily be a bit annoying because you need to figure out the ID# for each record by searching on the business-key, and it seemed like a good opportunity to implement a more generic matching feature:

  • Wiki: http://wiki.civicrm.org/confluence/display/CRMDOC/API+changes#APIchanges-4.4.0%27create%27and%27replace%27actionsaccept%27options.match%27or%27options.match-mandatory%27
  • Wiki: http://wiki.civicrm.org/confluence/display/CRMDOC/API+Reference#APIReference-Options
  • JIRA: http://issues.civicrm.org/jira/browse/CRM-13312
  • PR: https://github.com/civicrm/civicrm-core/pull/1560

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Updating records by matching a field

This forum was archived on 2017-11-26.