[Vtigercrm-developers] Custom field limit

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Vtigercrm-developers] Custom field limit

Stuart Maynard-Keene
Hi list, is there a limit to how many custom fields you can have for a module?

Currently the vtiger_leadscf table is standing at 325 fields (don’t ask!) and suddenly when I try to add new fields through the vTiger interface its stopped adding them to this table but still adds the relevant picklist tables.

Stu


_______________________________________________
http://www.vtiger.com/
VTE
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Vtigercrm-developers] Custom field limit

VTE
This post has NOT been accepted by the mailing list yet.
Stuart - you ran out of varchar() type of fields.

You are adding varchar(xxx) fields and mysql table only support so many of them, so while vtiger_field, vtiger_cf_xxx tables are created - nothing is added to vtiger_contactscf

The solution would be to reduce length of existing fields (if applicable) or just them to text in vtiger_contactscf.
VT Experts
Email: Support@VTExperts.com
Web: http://www.VTExperts.com
Skype: VTExperts
Phone: +1 (818) 495-5557


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Custom field limit

Sutharsan Jeganathan
In reply to this post by Stuart Maynard-Keene
Hi

I think it is due to MySQL Row size Limit
  1. To avoid this, you may use a script like below to add further fields in vtiger_leaddetails rather than vtiger_leadcf

    include_once('vtlib/Vtiger/Module.php');
    include_once('vtlib/Vtiger/Block.php');

    $blockInstance = new Vtiger_Block();
    $blockInstance = Vtiger_Block::getInstance('LBL_LEAD_INFORMATION');
    $fieldInstance = new Vtiger_Field();
    $fieldInstance->name = 'pickuplocation';
    $fieldInstance->label = 'Pickup Location';
    $fieldInstance->table = 'vtiger_leaddetails';
    $fieldInstance->column = 'pickuplocation';
    $fieldInstance->columntype = 'varchar(128)';
    $fieldInstance->uitype = 15;
    $fieldInstance->setPicklistValues(array('Makandana East','Yatawathura','Batakettara North','Moratumulla North'));
    $fieldInstance->typeofdata = 'V~O';
    $fieldInstance->defaultvalue = '';
    $blockInstance->addField($fieldInstance);
    echo 'ok';
  2. Otherwise you may try to convert varchar fields into tinytext in leadcf table, which can provide few more fields to accommodate.


Thanks

Sutharsan Jeganathan


On Tue, Feb 21, 2017 at 12:45 AM, Stuart Maynard-Keene <[hidden email]> wrote:
Hi list, is there a limit to how many custom fields you can have for a module?

Currently the vtiger_leadscf table is standing at 325 fields (don’t ask!) and suddenly when I try to add new fields through the vTiger interface its stopped adding them to this table but still adds the relevant picklist tables.

Stu


_______________________________________________
http://www.vtiger.com/


_______________________________________________
http://www.vtiger.com/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Custom field limit

Alan Lord (News)
In reply to this post by Stuart Maynard-Keene
On 20/02/17 19:15, Stuart Maynard-Keene wrote:
> Hi list, is there a limit to how many custom fields you can have for a module?
>
> Currently the vtiger_leadscf table is standing at 325 fields (don’t ask!) and suddenly when I try to add new fields through the vTiger interface its stopped adding them to this table but still adds the relevant picklist tables.


You should almost certainly redesign your module. I very much doubt
there is a need for ~350 fields in one module record...

But to answer your question, as Sutharsan has replied, you are probably
hitting MySQL column/row limits.

Alan

_______________________________________________
http://www.vtiger.com/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Custom field limit

Stuart Maynard-Keene
Thanks everyone, I’ve changed these picklist fields from VARCHAR(255) to VARCHAR(50) which has freed up some space.

When I took over this project there was 450+ fields in the leads module. I’ve probably added 20 new fields and redesigned it to total 350 so far, not bad going.

Stu

On 21/02/2017, 08:11, "[hidden email] on behalf of Alan Lord" <[hidden email] on behalf of [hidden email]> wrote:

    On 20/02/17 19:15, Stuart Maynard-Keene wrote:
    > Hi list, is there a limit to how many custom fields you can have for a module?
    >
    > Currently the vtiger_leadscf table is standing at 325 fields (don’t ask!) and suddenly when I try to add new fields through the vTiger interface its stopped adding them to this table but still adds the relevant picklist tables.
   
   
    You should almost certainly redesign your module. I very much doubt
    there is a need for ~350 fields in one module record...
   
    But to answer your question, as Sutharsan has replied, you are probably
    hitting MySQL column/row limits.
   
    Alan
   
    _______________________________________________
    http://www.vtiger.com/


_______________________________________________
http://www.vtiger.com/
Loading...