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) »
  • Saving custom data using API by anon user
Pages: [1]

Author Topic: Saving custom data using API by anon user  (Read 1057 times)

warecorp

  • Guest
Saving custom data using API by anon user
August 20, 2009, 06:01:56 am
I'm using CiviCRM 2.2.8 as a module for Drupal. I need to make a custom sign up (not a module for Drupal).
Standard fields are saved but fields from custom data are not:

$contact_data = array(
    'contact_type'  =>  'Individual',
    'hash'          =>  md5(microtime()),
    'first_name'    =>  'First',
    'middle_name'   =>  'Midle',
    'last_name'     =>  'Last',
    'email'         =>  'mail@mail.com',
    'contact_id'    =>  115,
    'custom_12'     =>  3,          //  Civi Select Integer Field
    'custom_13'     =>  2,          //  Civi Select Integer Field
    'custom_14'     =>  'some text' //  Civi Text Alphanumeric Field
);

$contact = civicrm_contact_add($contact_data);

var_dump($contact);

array(2) {
    ["contact_id"] => string(3) "115"
    ["is_error"] => int(0)
}



There is a similar thread http://forum.civicrm.org/index.php?topic=4722.0
How the problem can be solved?

Thanks in advance!

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Saving custom data using API by anon user
August 21, 2009, 06:34:04 am
- same params format is working fine for my local install.

can you make sure corresponding custom data group and custom data fields are active.
( go to  Administer CiviCRM -> Custom Data -> make sure group is active -> View and Edit Custom Fields -> make sure fields are active )

also delete all entries from civicrm_cache table ( query might be : TRUNCATE TABLE `civicrm_cache`; )

hope this help

kiran
You Are Designed To Choose... Defined By Choice.

warecorp

  • Guest
Re: Saving custom data using API by anon user
August 24, 2009, 05:11:39 am
Kiran,
Thank you for your reply. I'll check it and let you know if it helped.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Saving custom data using API by anon user

This forum was archived on 2017-11-26.