modify the custom created field type

How to modify the custom created field type?Thank you

Did you create it in Studio or from code?

Just change wherever you created it…

created in Studio,value=“int”,How can I change it to “varchar”

Oh, I see. Studio doesn’t let you change data type, because it would involve changes to the database, including to data in the database (not just structure).

Look for the definition under here (example for Contacts module):

custom/Extension/modules/Contacts/Ext/Vardefs/

Then make sure that your database matches the new definition. If you do a Quick Repair and rebuild, scroll down to see if it offers a button to change the database for you. If not do it manually.

Sorry, I still can’t find the change of this field type.


<?php
 // created: 2019-11-11 16:36:58
$dictionary['Contact']['fields']['companynumber_c']['inline_edit']='1';
$dictionary['Contact']['fields']['companynumber_c']['options']='numeric_range_search_dom';
$dictionary['Contact']['fields']['companynumber_c']['labelValue']='公司編號';
$dictionary['Contact']['fields']['companynumber_c']['enable_range_search']='1';
 ?>

Add this line in the file.


$dictionary['Contact']['fields']['companynumber_c']['type']='varchar';

thank you very much! I will try it later.

谢谢~