Making a field required

Hello,

iā€™ve tried to make a custom field required, but i got "value exist ", searching on the net i found that it was a bug, so iā€™ve tried to make it through code
the change i made was in the file custom\Extension\modules\Opportunities\Ext\Vardefs\sugarfield_myfield_c.php and i added the line
$dictionary[ ā€˜Opportunityā€™] [ ā€™ fieldsā€™] [ ā€™ myfield_cā€™ ] [ ā€™ requiredā€™]= true;
iā€™m wondering if that change is persistent, have any one of you an answer?

I donā€™t think that making fields required is bugged, can you share your findings? what you did is persistent because youā€™re working on custom folder.

best regards

here is a capture of the bug,
i wanna ask also how to make a field (not a custom one) required with code, for example for the field industry in the module opportunities ?

what you want to do is already possible in studio in the fields section, check it out

best regards

yes i tried it through studio, but the message ā€œinvalide name, name already existsā€ doesnā€™t allow me to save the change. I want to do it with code, is there a way to do it?