AnsweredAssumed Answered

Changing field type on a custom field breaks something in the studio

Question asked by KarlMetum KarlMetum on Aug 20, 2014
Latest reply on Aug 21, 2014 by KarlMetum KarlMetum
We're on SugarCRM 7.2.0 and we can not change the field type for a custom field that we have created on Account module without breaking some logic in the studio.

I have tried changing the field type for the field "phone_alternate" on Account module like this:
Inside /custom/Extension/modules/Accounts/Ext/Vardefs/sugarfield_phone_alternate.php:
<?php 
$dictionary['Account']['fields']['phone_alternate']['type']='clickToCall';
$dictionary['Account']['fields']['phone_alternate']['comments']='An alternate phone number';
$dictionary['Account']['fields']['phone_alternate']['merge_filter']='disabled';
$dictionary['Account']['fields']['phone_alternate']['calculated']=false;
 ?>
This works fine. But when I do this for a custom field like this...

<?php
$dictionary['Account']['fields']['my_custom_field_c']['labelValue']='Some random label';
$dictionary['Account']['fields']['my_custom_field_c']['enforced']='false';
$dictionary['Account']['fields']['my_custom_field_c']['dependency']='';
$dictionary['Account']['fields']['my_custom_field_c']['type']='somOtherType';
 ?>

.. I get an error inside studio when trying to change some attributes on that particular field. The error I'm getting is this: 
"Failed to retrieve data" and in my log-file I have this error:

Cannot modify field Query Failed: ALTER TABLE accounts_cstm modify COLUMN my_custom_field_c somOtherType NULL : MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'somOtherType NULL' at line 1

Any help is appreciated!

Outcomes