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) »
  • Custom Field Alias
Pages: [1]

Author Topic: Custom Field Alias  (Read 299 times)

elcongrio

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
  • CiviCRM version: 3.6.1
  • CMS version: Wordpress
  • MySQL version: 5.3
  • PHP version: 5.3.3
Custom Field Alias
August 12, 2014, 07:33:11 am
Hi Everyone:

There's a way to create some kind of alias to work with custom fields?
Everytime I need to wrote code to save a custom field, it's something like custom_10. I need to keep some kind of dictionary in every installation, to make sure that custom_x = the_field_i_need
Something I can do?

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Custom Field Alias
August 12, 2014, 01:57:48 pm
There's some discussion about using the CustomValue API to set fields based on their name instead of their ID -- http://forum.civicrm.org/index.php?topic=20564.0

FWIW, it would be possible to write a "wrapper" ( http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_apiWrappers ) for normal APIs which translates between "custom_123" and something nicer. However, that may be a bigger project than you're looking for.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Custom Field Alias

This forum was archived on 2017-11-26.