denorm_account_name too long

I am running into an issue with opportunities where the account name is too long for the denorm version:

'UPDATE opportunities SET denorm_account_name = ? WHERE id = ?' with params ["Ecole some very long name here that is more than 50 chars", "616793de-7c43-11ef-8422-001a4a160394"]:

Data too long for column 'denorm_account_name' at row 1

I noticed that account name on our accounts table is varchar(150) while the denorm_account_name on the opportunities table is varchar(50)

I don't remember, quite honestly, if we extended the original size of the account name to match our Oracle ERP back when we started using Sugar in 2010.

Has anyone else run into this issue? 

FrancescaS

 

  • Hi  ,

    Both the accounts.name and opportunities.denorm_account_name field are varchar(255) in the default schema, so it seems likely these values were reduced through extended vardefs or manual database schema updates. At a minimum, I recommend increasing the denorm_account_name on Opportunities to match your accounts.name length. I recommend also checking the denorm_account_name column on other tables such as contacts, cases, etc. to prevent similar failures.

    Chris

  • This is very odd. I have Extensions for the denorm_account_name but I wasn't the one who did this, and I'm the only one who works in Sugar.

    Revenue Line Items is new to us and I've not put it in use yet.

    So something in the upgrade process added these:

    Fullscreen
    1
    2
    3
    4
    custom/Extension/modules/Cases/Ext/Vardefs/denorm_account_name.php
    custom/Extension/modules/Contacts/Ext/Vardefs/denorm_account_name.php
    custom/Extension/modules/Opportunities/Ext/Vardefs/denorm_account_name.php
    custom/Extension/modules/RevenueLineItems/Ext/Vardefs/denorm_account_name.php
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • In my experience, the Extension vardef files are normal and the 'len' attribute is typically defined there. I'm not sure why it would have it to 50 instead of either the default of 255 or a length matching your accounts.name definition. I think it's safe to make the adjustments as I haven't seen these settings get overwritten for any of our clients.

    Chris