[solved] Studio: unable to set default value and deselect inline_edit in DropDown field

pretty weird:

we are in studio, trying to save the following (which is what we want)

save it, and I get this one

then I try again, and I get this one

do you have any idea on how to debug?

(we fix permissions in files, and did a repair, but nothing changes)

I’m not sure what the real problem is. The first thing I suspected was the file permissions but you say all is correct there. (Check one more time just in case something is missing.)

If it doesn’t work, the option will be to add it manually by modifying the field definition here:

custom/Extension/modules/YOUR-module/Ext/Vardefs

and add something like:

$dictionary['YOUR-Module']['fields']['TheFieldName']['default_value']=''; 

Please note that in this case the default value needs to be the actual value of the selection, not the label.

1 Like

Hi @fraxx
Please follow the step

Step 1-


Step 2:- If you show the dropdown in editview setting

Step 3:- In Listview setting

Step 4:- Here is EditView DropDown

Step 5- On ListView-

thanks vijay1992 but the issue is not related to the view.

BrozTechnologies, thank you for your answer and sorry for the late reply:

Yes I confirm file permission is fine

After trying several combinations, we were able to reach the result, but we have no idea how (and are unable to re-do it), so the problem still exists.

so do I have to create a file inside the directory custom/Extension/modules/YOUR-module/Ext/Vardefs with the code you wrote? should that file have some special name/extension?

I see the code should be

$dictionary['Lead']['fields']['lead_source']['default']='do_not_fill_on_conversion';

but I added it in file custom/Extension/modules/Leads/Ext/Vardefs/myfile.php and I get a FATAL on repair: I guess I should use a special file name?

omg, the fatal was caused by an empty line in the file custom/Extension/modules/Leads/Ext/Vardefs/myfile.php, so yes, BrozTechnologies , you are perfectly right: I’ve added the following:

cat  custom/Extension/modules/Leads/Ext/Vardefs/myhack_for_lead_source.php
$dictionary['Lead']['fields']['lead_source']['default']='do_not_fill_on_conversion';
$dictionary['Lead']['fields']['lead_source']['required']=true;
$dictionary['Lead']['fields']['lead_source']['audited']=false;
$dictionary['Lead']['fields']['lead_source']['inline_edit']='';
$dictionary['Lead']['fields']['lead_source']['comments']='Lead source (ex: Web, print)';
$dictionary['Lead']['fields']['lead_source']['merge_filter']='disabled';

and, after the quick-repair, it works!

Side note: then I saw that if I edit again in Studio, a new file is produced, that will override my settings: custom/Extension/modules/Leads/Ext/Vardefs/_override_sugarfield_lead_source.php so I see that I just need to remove it!

So, I finally found out the perfect solution: I just had to remove the old custom/Extension/modules/Leads/Ext/Vardefs/_override_sugarfield_lead_source.php the go back to the Studio and just setup as I need, then it works, without the need of a custom file: this means, with no doubt, that

  • our web changes in studio, create (or created in the past) a wrong: custom/Extension/modules/Leads/Ext/Vardefs/_override_sugarfield_lead_source.php, so to reset, we just have to remove the file and do changes again in Studio (web).

I suspect that the web JS (of php) code that the editing of the field in studio has some issue (maybe just with our browser? Firefox): I suspect this since sometime when I save changes, the interface goes back to the edit where I see changes applied: some other, when I hit save, I go back to the fields’ list and stay there.

Anyhow, this is solved, that you so much to BrozTechnologies for the great tip!

1 Like