I had a custom field group with a disabled field.

  1. When I tried to delete the field (ID=59), the Warning window froze with CRM logo rotating.

  2. When I tried to enable the field, it gave Error about DB Constraint Violation, but apparently enabled the field.

  3. When I tried to delete the field then, the Warning window froze again with CRM logo rotating.

The screenshot contains combined messages - error from action 2 and warning window from action 3.

How can I fix the issue?

P.S. Editing the field 59 does not work either (also frozen logo after clicking save).

enter image description here

I am running CiviCRM 5 on Drupal 7.

  • as a hint. in such situations of spinning logo if instead you right-click and run the task in a separate tab/window you are more likely to see the error involved.
    – petednz - fuzion
    Commented Mar 16, 2021 at 18:39

1 Answer 1


There are a few ways to delete a custom field other than the UI:

  • Use the API Explorer and then entity CustomField / CustomGroup. That will allow you to delete them, but you will need to know the ID of the CustomField or CustomGroup. You can find that with the API Explorer as well. More info: https://docs.civicrm.org/dev/en/latest/api/#api-explorer
  • In the database, but will need to know exactly what you are doing! This is not something to recommend without a sound knowledge of the CiviCRM database. You have to make sure all the tables and data are correct and in sync with each other. There are a few tables involved:
  • civicrm_custom_group, which holds the details of the custom group. One of the columns is the table_name, which will hold the name of the table where the actual custom data is
  • civicrm_custom_field, which holds the details of the custom fields, linked with the column custom_group_id. One of the columns is column_name, which is the name of the column in the actual table with data
  • Erik, thank you very much. It did not work with API Explorer v3.0, but went smoothly with API Explorer 4.0.
    – Aivars
    Commented Mar 16, 2021 at 9:12
  • 1
    Happy to hear that! Commented Mar 16, 2021 at 14:24

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.