How to increase the size of a TextArea field in SugarCRM / SuiteCRM

In SugarCRM or in SuiteCRM the TextArea type fields are automatically created on databases as TEXT fields, that is multi-line text fields that can store up to 65,535 bytes (64 Kb.).

Sometimes however, you need a larger number of bytes, for example to store an XML or a JSON or for larger literary texts, or for texts written in languages ​​that use many MultiByte characters, such as the Arabic or Chinese (in general, in a UTF-8 text, each character uses a number of bytes between 1 and 4).

I found a simple Upgrade-Safe method to transform TextArea fields into larger fields, such as LONGTEXT, which can store up to 4,294,967,295 bytes (4 Gb.).

You simpy need to create a file in custom/Extension/modules/<module_name>/Ext/Vardefs with:

<?php
$dictionary['<modulename>']['fields']['<fieldname>']['dbType'] = 'longtext';
?>

Executing a “Quick Repair and Rebuild“, the system will automatically prepare the query to update the database, executing which you will no longer have to worry about finishing the space available in your TextArea field.

Note :

1. Here, <module_name> means the module name you see in the URL, for example, Contacts, Leads, Accounts, etc.

Hope you find this blog post helpful.

Feel free to add comments and queries, that helps us to improve the quality of posts.

You can contact us at info@infotechbuddies.com

Thank you.

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *