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/
with
<?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
Itās
$dictionary[āOpportunityā]
with a capital O, not a lower case o
Hi pgr,
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 custom/Extension/modules
Hi,
The easiest would be to add
'displayParams' =>
array (
'required' => true,
),
to assigned_user_name in editviewdefs.php
Hi blqt<
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
Hi again,
Thanks for your suggestions.
Iāve resolved the issue using mikebeckās answer in this fairly old thread Field assignment
I realise I made the earlier mistake of not going custom/Extension - instead I went down custom/modulesā¦
Apologies for the ineptitude/inability to read