Change existing field data type

Hi,
I have created list of fields in integer data type. but i want to change those fields data type. Actually i changed in back end but there is no reflect in front end screen. Does anyone help me?

Hi guys i found the solution. go to modules/(module_name)/vardefs.php . find the field name and change the type then repair.

It’s simple… But you have to modify the CRM code files Goto custom -> Extension -> modules -> <module_name> -> Ext -> Vardefs -> <field_name>.php
add the below line in the file
$dictionary[‘module_name’][‘fields’][‘field_name’][‘type’]=‘data_type’;
e.g.
$dictionary[‘Customers’][‘fields’][‘height’][‘type’]=‘float’;

Repair Rebuild so that it will sync the vardefs with DB… B) B)

1 Like

It’s simple… But you have to modify the CRM code files Goto custom -> Extension -> modules -> <module_name> -> Ext -> Vardefs -> <field_name>.php
add the below line in the file
$dictionary[‘module_name’][‘fields’][‘field_name’][‘type’]=‘data_type’;
e.g.
$dictionary[‘Customers’][‘fields’][‘height’][‘type’]=‘float’;

Repair Rebuild so that it will sync the vardefs with DB… B) B)

1 Like

Just in case someone need to do this.

I’ve changed it like @mustafa_taheri but it look like it wasnt enough, I change it directly in the database, table “fields_meta_data”, after that I re-saved the field in the studio just to update the type (look like its mandatory). And now it changed the type completly.

1 Like

So, If I am using PhpMyAdmin. I just go into the DB “fields_meta_data” table and update and EDIT/ change the TYPE from “INT” to “TEXT” ? - No other change required? ( In addition to steps by mustafa_taheri )

Just being sure -
If my code looks like this:

<?php
 // created: 2019-12-04 00:17:13
$dictionary['Project']['fields']['secondary_invoice_status_c']['inline_edit']='1';
$dictionary['Project']['fields']['secondary_invoice_status_c']['labelValue']='Midpoint INV Stat';
$dictionary['Project']['fields']['secondary_invoice_status_c']['type']='text';

 ?>

IM trying to switch from integer “int” to “text”

Thanks bro, your logic work but when the datatype is Relate and it Relate with user’s module then how we relate that particular field linked with particular module.

Hi,
I find the solution for Related field as:-
$dictionary[‘AOS_Contracts’][‘fields’][‘contractverifiedby_c’][‘labelValue’]=‘Contract Verified By’;

$dictionary[‘AOS_Contracts’][‘fields’][‘contractverifiedby_c’][‘type’] = ‘relate’;

$dictionary[‘AOS_Contracts’][‘fields’][‘contractverifiedby_c’][‘module’] = ‘Users’;

$dictionary[‘AOS_Contracts’][‘fields’][‘contractverifiedby_c’][‘ext2’] = ‘Users’;

$dictionary[‘AOS_Contracts’][‘fields’][‘contractverifiedby_c’][‘table’] = ‘users’;

$dictionary[‘AOS_Contracts’][‘fields’][‘contractverifiedby_c’][‘studio’] = ‘visible’;

$dictionary[‘AOS_Contracts’][‘fields’][‘contractverifiedby_c’][‘id_name’] = ‘users.id’;