2

When I try to add or edit an "Employee of" Relationship, I get a "no such field" error, although this field exists in the database. Any ideas how to proceed?

CiviCRM 5.48.2; MySQL:5; PHP 7.4

From error log

    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] => INSERT INTO `civicrm_relationship` (`contact_id_a` , `contact_id_b` , `relationship_type_id` , `start_date` , `end_date` , `is_active` , `description` , `is_permission_a_b` , `is_permission_b_a` ) VALUES ( 55680 ,  1377 ,  4 ,  NULL ,  NULL ,  1 , '' ,  0 ,  0 )  [nativecode=1054 ** Unknown column 'created_date' in 'field list']
    [type] => DB_Error
    [user_info] => INSERT INTO `civicrm_relationship` (`contact_id_a` , `contact_id_b` , `relationship_type_id` , `start_date` , `end_date` , `is_active` , `description` , `is_permission_a_b` , `is_permission_b_a` ) VALUES ( 55680 ,  1377 ,  4 ,  NULL ,  NULL ,  1 , '' ,  0 ,  0 )  [nativecode=1054 ** Unknown column 'created_date' in 'field list']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="INSERT INTO `civicrm_relationship` (`contact_id_a` , `contact_id_b` , `relationship_type_id` , `start_date` , `end_date` , `is_active` , `description` , `is_permission_a_b` , `is_permission_b_a` ) VALUES ( 55680 ,  1377 ,  4 ,  NULL ,  NULL ,  1 , '' ,  0 ,  0 )  [nativecode=1054 ** Unknown column 'created_date' in 'field list']"]
)```

1 Answer 1

2

Do you have logging turned on (admin - system settings - misc)? If so then the log table is probably out of sync. Check log_civicrm_relationship to see if it has the field. If it doesn't have the field, try admin - system settings - clear cache and also rebuilding triggers: https://docs.civicrm.org/sysadmin/en/latest/troubleshooting/#trigger-rebuild

https://example.org/civicrm/menu/rebuild?reset=1&triggerRebuild=1

1
  • 1
    Thank you so much. This solved the problem.
    – xtylus
    May 4, 2022 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.