How can I make the “assigned to” field a required field, so it can’t be empty?
Maybe you can check the field using a logic hook and see if the field is empty? Will that work?
That would work as a last resort. But I’m looking for a functionality that works like all other required fields, i.e. user can’t save unless field is not empty.
I don’t really have time to check now, but isn’t there something in the vardefs where you say a field has required=true or something?
pgr yes that’s it. forgot about that. Thanks.
Added file to /custom/Extension/modules/[MODULENAME]/Ext/Vardefs/
<?php $dictionary['[MODULENAME]']['fields']['assigned_user_name']['required']=true; ?>
after quick rebuild it’s now a required field.
Apologies for the rez.
We’re trying to make Assigned User a required field in Opportunities and we’ve had no luck with the solution here.
We’ve tried the snippets below - has anyone managed this?<?php $dictionary['opportunity']['fields']['assigned_user_name']['required']=true; ?>
Saved in /custom/modules/Opportunities/Ext/Vardefs/assigned_user_name.php
and<?php $dictionary['opportunity']['fields']['assigned_user_id']['required']=true; ?>
Saved in /custom/modules/Opportunities/Ext/Vardefs/assigned_user_id.php
7.11.5 on CentOS 6
with a capital O, not a lower case o
I’ve made the changes to capitalise the O but still no change
Could this be a relationship to Users issue?
Now on 7.11.18 CentOS 7
Sorry, if that’s not it, I don’t know what the problem could be. Setting a breakpoint in the code will let you examine the entire currently loaded dictionary, which is usually the best way to make sure you’re using the correct module and field names.
Set the breakpoint in the file that is generated by the Quick Repair and Rebuild, that is, look for it under
The easiest would be to add
'displayParams' => array ( 'required' => true, ),
to assigned_user_name in editviewdefs.php
Thanks for the suggestio. I’ve tried as you said + repair/rebuild - still no change unfortunately.
I trust I’ve entered it correctly?
What you did is not correct.
It should be
array ( 'name' => 'assigned_user_name', 'label' => 'LBL_ASSIGNED_TO_NAME', 'displayParams' => array ( 'required' => true, ), ),
You need to do that in another array like you have for name and currency_id
array ( array ( 'name' => 'assigned_user_name', 'label' => 'LBL_ASSIGNED_TO_NAME', 'displayParams' => array ( 'required' => true, ), ), ),
Then, Repair/Quick Repair