Odd SQL error

Im getting this SQL error when I try and save an account. Any ideas?

SET name=‘Richard’,date_modified=‘2014-10-01 12:32:28’,modified_user_id=‘1’,created_by=‘1’,description=‘Imported from ELANRA list\r\nDepression Headaches Tension Muscle soreness’,assigned_user_id=‘1’,account_type=NULL,industry=NULL,annual_revenue=NULL,phone_fax=NULL,billing_address_street=‘23 Walton St\r\nEnfield’,billing_address_city=NULL,billing_address_state=‘Middlesex’,billing_address_postalcode=‘EN2 0LB’,billing_address_country=‘United Kingdom’,rating=NULL,phone_office=NULL,phone_alternate=NULL,website=NULL,ownership=NULL,employees=NULL,ticker_symbol=NULL,shipping_address_street=NULL,shipping_address_city=NULL,shipping_address_state=NULL,shipping_address_postalcode=NULL,shipping_address_country=NULL,parent_id=’’,sic_code=NULL,campaign_id=[color=#bb4400]’’,=NULL[/color]

it looks like it is trying to update a field at the end of the statement, but doesn’t know the field name :s

Hi there,

Do you have any customisations? Have you tried running a Quick Repair & Rebuild and Rebuild Relationships in Admin -> Repair.

Is this a fatal error? Does the saving of the account record fail?

Thanks,

Will.

Tried rebuilding it but nothing.

One thing I have noticed, is in Studio -> Module -> Fields I have a field that has the name of ‘null’ no label and no type.

Guessing it’s this that is throwing it, but can’t seem to remove it by using studio.

Hi there,

This is normally due to a missing field. This is normally resolved by copying across the fields_meta_data values from the old to new db.

It may be worth checking if there is a mismatch between your old db and new db for the fields_meta_data table.

Did you upgrade or is this a fresh installation?

Thanks,

Will.

The strange thing is I wasn’t doing any DB stuff. Just adding some custom fields.

I restored a DB from this morning, before I done any changes, still getting the error, but now getting two null fields !!!

SET name=‘Summer’,date_modified=‘2014-10-01 14:12:21’,modified_user_id=‘1’,created_by=‘1’,description=NULL,assigned_user_id=‘1’,account_type=NULL,industry=NULL,annual_revenue=NULL,phone_fax=NULL,billing_address_street=‘Bremhill Grove Farmhouse’,billing_address_city=‘East Tytherton’,billing_address_state=‘Wilts’,billing_address_postalcode=‘SN15 4LX’,billing_address_country=‘United Kingdom’,rating=NULL,phone_office=NULL,phone_alternate=NULL,website=NULL,ownership=NULL,employees=NULL,ticker_symbol=NULL,shipping_address_street=NULL,shipping_address_city=NULL,shipping_address_state=NULL,shipping_address_postalcode=NULL,shipping_address_country=NULL,parent_id=’’,sic_code=NULL,campaign_id=’’,[color=#ffbb00]=NULL,=NULL[/color]

and I have two NULL fields in the field editor now :s

Hi there,

There could also be a mismatch between fields in custom/Extension and the database/studio. You would need to compare the fields in studio to those in custom/Extension/yourmodule to find which fields to remove.

Thanks,

Will.

Howdy,

Yeah just worked that one it. There was two sugarfieldsXXXX_C.php files that were not being used in /custom/Extension/modules/Accounts/Ext/Vardefs

Deleted them and problem solved :slight_smile: