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) »
  • Creating a custom field of type "String/Radio" with options via API
Pages: [1]

Author Topic: Creating a custom field of type "String/Radio" with options via API  (Read 312 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Creating a custom field of type "String/Radio" with options via API
May 11, 2014, 04:41:31 pm
My goal is to create a new custom field (type String/Radio) with a newly created list of options. 

What I am able to do successfully via the API:
  - Create a the option list via the API using civicrm_api('OptionGroup', 'create', $params)
  - Create the new custom field of type "string/radio" via the API using civicrm_api('CustomField','Create', $params);   

What is not working in version 4.4.4 and 4.4.5 ( but did work in 4.3.8 )
  When I create the custom field, two of the parameters are:
           [options_per_line] => 1
           [option_group_id] => $tmp_option_group_id


The result in version 4.4.x is that the param 'option_group_id' is ignored, and the field gets associated with a auto-created option group with no option values. 

Any ideas on why the param 'option_group_id' is getting ignored in version 4.4.x when creating a custom field?

« Last Edit: May 11, 2014, 05:05:14 pm by epg »
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Creating a custom field of type "String/Radio" with options via API

This forum was archived on 2017-11-26.