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 (Moderator: Donald Lobo) »
  • Adding custom groups/fields using the CiviCRM API
Pages: [1]

Author Topic: Adding custom groups/fields using the CiviCRM API  (Read 1918 times)

dougall

  • Guest
Adding custom groups/fields using the CiviCRM API
March 19, 2008, 05:25:52 am
Hi,

I'm writing a module to work with CiviCRM and I'm trying to add some custom groups/fields to Individual using the CiviCRM API when the module is first installed. I'm using CiviCRM version 1.9 for Drupal.

I just want there to be a simple textfield for entering/editing my new custom field, but I'm also wondering what all the valid values are for "html_type" in $params when calling the API
Code: [Select]
function crm_create_custom_field(&$custom_group, $params)
Also is there anything else I have to do to get a textfield to enter data for my custom field when adding/editing an Individual?

Thanks,
  Dougall
« Last Edit: March 19, 2008, 05:59:07 am by dougall »

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Adding custom groups/fields using the CiviCRM API
March 19, 2008, 08:11:05 am
Daugall:

You might want to check: http://biryani.osuosl.org:8181/browse/~raw,r=10005/CiviCRM/trunk/test-new/SimpleTest/api-v2/CustomFieldCreate.php

kurund
Found this reply helpful? Support CiviCRM

dougall

  • Guest
Re: Adding custom groups/fields using the CiviCRM API
March 19, 2008, 11:25:47 am
hi kurund,

good stuff ... a working example is exactly what i needed

also i realised i can easily investigate up what params are allowable by looking at the administer custom groups/fields pages inside civicrm, and simpy seeing what's available there (i should have thought of this before!)

anyway many thanks for the link ... dougall

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Adding custom groups/fields using the CiviCRM API

This forum was archived on 2017-11-26.