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) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Accessing custom fields data from API
Pages: [1]

Author Topic: Accessing custom fields data from API  (Read 787 times)

jsherk

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 0
Accessing custom fields data from API
April 28, 2010, 10:47:50 am
Regarding inserting, adding or updating information in custom fields from API...

After a whole day (14+ hours) of trying to figure this out, I finally figured out that if I have a custom field that has a name in the database table called orders_2 then I need to just use the _2 part (not the orders part) and add the word custom like this:
$params['custom_2']='data';

I put info in wiki here:
http://wiki.civicrm.org/confluence/display/CRMDOC/Custom+Data+Group+and+Custom+Field+APIs

I hope this saves at least one person a whole day of struggling!!

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Accessing custom fields data from API
April 28, 2010, 11:11:31 am
Thank you for the wiki update. This information is also here http://forum.civicrm.org/index.php?topic=4722.0 entitled "Adding custom field data using the API"
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

jsherk

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 0
Re: Accessing custom fields data from API
April 28, 2010, 11:30:22 am
My issue was, that after all the reading I did, I never picked up on the fact that I should use custom_123 instead of the actual field name in the table like myname_123 ... I assumed (never assume) that whenever I saw custom_ in an example that it was just a placeholder that was saying "put the name of your custom field here" ... of course what it was really saying was "no really, use the word custom_"!!!!


Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Accessing custom fields data from API
April 28, 2010, 11:41:27 am
LOL

There was also a blog somewhere that I can't find now on this subject.

Anyhow, glad to hear it's clear now. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Accessing custom fields data from API

This forum was archived on 2017-11-26.