MySQL error 1054: Unknown column 'assigned_user_id' in 'field list'

Hi,

while importing tasks into SuitCRM, I encounterd the following error:

Error filling in additional detail fields: Query Failed: SELECT first_name, last_name, assigned_user_id parent_name_owner from users where id = ‘4ee8c400-da78-e021-1ec1-5ef36acd33dc’: MySQL error 1054: Unknown column ‘assigned_user_id’ in ‘field list’
Mon Jul 20 12:26:43 2020 [18240][3adbec7a-0269-e4f5-4211-5ebcfaf5b33a][FATAL] Exception handling in /var/www/html/SuiteCRM/include/MVC/Controller/SugarController.php:400
Mon Jul 20 12:26:43 2020 [18240][3adbec7a-0269-e4f5-4211-5ebcfaf5b33a][FATAL] Exception in Controller: Database error. Look for details into the error log of SuiteCRM

I tried to assign a user to a task, by filling the “assign_to_type” and “assign_to_ID” with “Users” and the reference ID from the user.
I’ve got the Database error, and since then I’m not able to see a list of tasks in SuiteCRM (although there are many other tasks in the database)

Already tried to repair the database, using the quick repair option: no result.

Please help, any suggestions how to solve this?

The users table doesn’t seem to have an assigned_user field, so no wonder it can’t import…

True, but that doesn’t seem to be the problem…

I used the import format for tasks and in that .csv file there is a relate_to_type field and a relate_to_ID field. Just the same as for example in the import format for Calls. When using the value “Users” in Relate_to_Type field, it’s possible to relate more than one user to a call.
When I use the same approach for tasks, I get the database error. Still no problem if I cn’t import more than one user per task, but now I can’t get to the other tasks in SuiteCRM. When I want to see the list of tasks, I get the screen as attached to my post.

So, I had no problem seeing the lists of tasks BEFORE I tried to import more users assigned to 1 task. After that, my database seems inconsistent…
And I can’t find a way to repair that!

Which screen is giving you that error?

Sometimes the inconsistency is only in a list view or dashlet filter, and it can be cleared by resetting the user profile.

It was the listview of tasks…

But, we solved the problem. A little bit drastic, but it works!
We deleted the records in the task table, which contained the value “Users” in the parent-id field. For some reason it was possible to import these records, but that created the error on the task view.

I’m still hoping to get a permanent solution for this, but for now I’m happy that SuiteCRM is working properly again. :blush:

Thanks for all the reactions!

1 Like

Hello,

I am glad that your project is up and running.

Dropping fields or records from the Database is not the right solution at all.

Sometimes your fields are foreign key in other fields, and by dropping the fields, you are deleting the complete relation between tables.

What I am suggesting is that go through your tables and find the primary key - foreign key relations between your tables.

Best Regards,