I’m trying to make a field in the opportunities required if the sales_stage is equal to “Closed Lost”.
There are surprisingly few posts on this topic. There are a couple that insert JS to change the class of the field, which seems kind of bulky if you have more than a few fields.
I see there is a Sugar feature which seems to go way back for $dependencies.
Does anyone know if this is still part of SuiteCRM? This seems like a really elegant way to handle this kind of issue and many others.
I’m trying this but it doesn’t seem to be working and I don’t know if it’s because I made a mistake or if this feature is no longer in SuiteCRM.
(I know there’s a spelling mistake in lost_reson_c)
<?php if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); // custom/Extension/modules/Opportunities/Ext/Dependencies/custom_dependency.php $dependencies['Opportunities']['CustomDependencyName'] = array( 'hooks' => array("edit"), 'trigger' => 'true', 'triggerFields' => array('sales_stage'), 'onload' => true, 'actions' => array( array( 'name' => 'SetRequired', 'params' => array( 'target' => 'lost_reson_c', 'label' => 'lost_reson_c', 'value' => 'equal($sales_stage, "Closed Lost")', ), ), ), );