MySQL error 1054: Unknown column even after repair and rebuild


I always encounter this issue in the suitecrm error log:

MySQL error 1054: Unknown column ‘contacts.lead_source’ in ‘where clause’

I’ve already done Quick Repair and Rebuild many times and it always shows Database tables are synced with vardefs

Can anyone please guide me how to resolve this issue?

This topic may help you debug your issue:

Hi Will,

I checked the folder but it doesn’t have those files.

these are not existing:


Hi Will,

This is what happening please see attached screenshot.

I have managed to add the contact lead source in the search view of meeting.

However, I just can’t search the list by lead source. It always says “No result found”.

I checked the error log, and had this: MySQL error 1054: Unknown column ‘contacts.lead_source’ in ‘where clause’
even after a successful repair and rebuild

custom vardef_ext_lead_source.php:

$dictionary[“Meeting”][“fields”][“lead_source”]= array(
‘name’ => ‘lead_source’,
‘vname’ => ‘LBL_LEAD_SOURCE’,
‘query_type’ => ‘default’,
‘source’ => ‘non-db’,
‘type’ => ‘enum’,
‘options’ => ‘lead_source_dom’,
‘studio’ => array(‘searchview’=>true,‘visible’=>false),

custom SearchFields.php:

‘lead_source’ =>
array (
‘query_type’ => ‘default’,
‘db_field’ =>
array (
0 => ‘contacts.lead_source’,

custom searchdefs:

‘lead_source’ =>
array (
‘type’ => ‘enum’,
‘default’ => true,
‘studio’ => ‘visible’,
‘label’ => ‘LBL_LEAD_SOURCE’,
‘width’ => ‘10%’,
‘name’ => ‘lead_source’,

Am I missing something?


It is missing a join clause… please guide me how to resolve this

error log:

Query Failed: SELECT ,meetings_cstm.meetingtype_c, meetings.date_start , jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner , ‘Users’ assigned_user_name_mod, meetings.parent_id , meetings.parent_type , meetings.date_entered , jt1.user_name created_by_name , jt1.created_by created_by_name_owner , ‘Users’ created_by_name_mod, meetings.assigned_user_id FROM meetings LEFT JOIN meetings_cstm ON = meetings_cstm.id_c LEFT JOIN users jt0 ON AND jt0.deleted=0

AND jt0.deleted=0 LEFT JOIN users jt1 ON AND jt1.deleted=0

AND jt1.deleted=0 where ((contacts.lead_source in (‘Canvassing’))) AND meetings.deleted=0 ORDER BY meetings_cstm.meetingtype_c ASC LIMIT 0,21: MySQL error 1054: Unknown column ‘contacts.lead_source’ in ‘where clause’


Any idea please?

Need some help on this. Can’t figure out what I am missing.

Any help please? I can’t seem to move on with this issue. :frowning:

Any update please?


Maybe ; create manually in leads table this fields with SQL manager or another program.

lead_source VARCHAR 100 allow null



its already present in the table of leads.

Any idea why I keep on encountering the issue?

In meeting module, it is missing a join clause. Any solution please?

Hi All,

Still stuck on this issue… :unsure: :unsure: :unsure:

I will really appreciate any idea…

If i understand, you will research contacts in Meetings ?

For me, it’s hard to resolve this becauses :

Meetings have a “relate field” to many modules … : theses 2 fields are parent_id and parent_type
The contacts subpanel is not a contacts subpanel but come from : meetings_contacts who store : Accept/Decline Status and the id of the contact.

I have no skill for find a solution for that

Good luck.

issue resolved

Could you share the solution so that, if others experience the same issue, they may try it?


by setting the ‘unified_search’ => true, of lead_source in vardefs and adding the column contact in the list view via studio resolved this issue