Be careful on what you mean by max…

sugarcrmdevelopers —  August 28, 2013 — Leave a comment

I came across this blog post the other day from Suga Angel Magaña, talking about the following error he saw on an instance he was working on…

MySQL error 1439: Display width out of range for column '<some_field_name>' (max = 255)

What the problem amounted to was a misinterpretation on what the ‘Max Size’ entry meant in Studio. From the blog…

When defining an integer field within the Studio tool in SugarCRM, the parameter that controls this width is labeled Max Size. In contrast, the maximum value that a given field can hold is controlled by the parameter in the field labeled Max Value. Please see the image below and note these two parameters.

Sometimes this distinction causes some confusion and the two values are mixed up, resulting in values greater than 255 in the Max Size field. For example, someone might mistakingly enter 1,000,000 to indicate the largest value the field should accept is one million. This in turn exceeds the hard limit of 255 and results in the above referenced error. 

So make note of this distinction. While you may want to set a limit of the value entered, you should always set the ‘Max Size’ to the maximum number of digits you want the field to accept ( including decimal places and the decimal point ).

Thanks Angel for this tip!

No Comments

Be the first to start the conversation!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s