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) »
  • Custom Data Add field Error
Pages: [1]

Author Topic: Custom Data Add field Error  (Read 2086 times)

John

  • Guest
Custom Data Add field Error
March 25, 2009, 09:44:32 pm
Hello To All
In CiviCrm when i use Custom Data(Home>Administer CiviCrm>Custom Data>add field) and add field  an error come. This error
"

unrecoverable error
    Sorry. A non-recoverable error has occurred.

    DB Error: constraint violation

    Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`nasiv2/civicrm_custom_field`, CONSTRAINT `FK_civicrm_custom_field_custom_group_id` FOREIGN KEY (`custom_group_id`) REFERENCES `civicrm_custom_group` (`id`) ON DELETE CASCADE), 1452

    Return to home page.

Error Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_custom_field (custom_group_id , label , data_type , html_type , default_value , is_required , is_searchable , is_search_range , weight , help_post , is_active , is_view , options_per_line , text_length , start_date_years , end_date_years , date_parts , note_columns , note_rows , column_name , option_group_id ) VALUES ( 6 , 'Created By' , 'String' , 'Text' ,  NULL ,  0 ,  0 ,  0 ,  1 ,  NULL ,  1 ,  0 ,  NULL ,  255 ,  NULL ,  NULL , 'MdY' ,  60 ,  4 , 'created_by' ,  NULL )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`nasiv2/civicrm_custom_field`, CONSTRAINT `FK_civicrm_custom_field_custom_group_id` FOREIGN KEY (`custom_group_id`) REFERENCES `civicrm_custom_group` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_custom_field (custom_group_id , label , data_type , html_type , default_value , is_required , is_searchable , is_search_range , weight , help_post , is_active , is_view , options_per_line , text_length , start_date_years , end_date_years , date_parts , note_columns , note_rows , column_name , option_group_id ) VALUES ( 6 , 'Created By' , 'String' , 'Text' ,  NULL ,  0 ,  0 ,  0 ,  1 ,  NULL ,  1 ,  0 ,  NULL ,  255 ,  NULL ,  NULL , 'MdY' ,  60 ,  4 , 'created_by' ,  NULL )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`nasiv2/civicrm_custom_field`, CONSTRAINT `FK_civicrm_custom_field_custom_group_id` FOREIGN KEY (`custom_group_id`) REFERENCES `civicrm_custom_group` (`id`) ON DELETE CASCADE)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_custom_field (custom_group_id , label , data_type , html_type , default_value , is_required , is_searchable , is_search_range , weight , help_post , is_active , is_view , options_per_line , text_length , start_date_years , end_date_years , date_parts , note_columns , note_rows , column_name , option_group_id ) VALUES ( 6 , 'Created By' , 'String' , 'Text' ,  NULL ,  0 ,  0 ,  0 ,  1 ,  NULL ,  1 ,  0 ,  NULL ,  255 ,  NULL ,  NULL , 'MdY' ,  60 ,  4 , 'created_by' ,  NULL )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`nasiv2/civicrm_custom_field`, CONSTRAINT `FK_civicrm_custom_field_custom_group_id` FOREIGN KEY (`custom_group_id`) REFERENCES `civicrm_custom_group` (`id`) ON DELETE CASCADE)]"]
)


"
Why This Error is coming ? and How we can solve it?
Thanks

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: Custom Data Add field Error
March 25, 2009, 09:51:02 pm
Can you update your forum profile. Please replicate this issue on http://drupal.demo.civicrm.org

Kurund
Found this reply helpful? Support CiviCRM

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Custom Data Add field Error
March 26, 2009, 12:25:16 am
Hi,

I did a forum search on 'REFERENCES `civicrm_custom_group` and got a couple of similar sounding problems - not sure if they apply because I don't know your version.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom Data Add field Error

This forum was archived on 2017-11-26.