AnsweredAssumed Answered

Readonly is not working for dropdown field data condition

Question asked by Thiraviarajan Raman on Jul 30, 2020

For readonly field based on condition i followed this guide https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_10.0/Architecture/Sugar_Logic/Dependenc…  and replicate the same code for dropdown field, its now working.

 

Based on above guide below code is working in our instance, but its not working for dropdown field mentioned below (2nd part of code)

 

Sample Code shared in Sugar documentation - This is working fine, lock_record_c is Checkbox field.

<?php
$dependencies['Opportunities']['readonly_fields'] = array(
'hooks' => array("edit"),
'trigger' => 'true',
'triggerFields' => array('lock_record_c'),
'onload' => true,
'actions' => array(
array(
'name' => 'ReadOnly',
'params' => array(
'target' => 'total_sqft_rqrd_site_1_c',
'value' => 'equal($lock_record_c,true)',
),
),
),
);
?>

We replicated the same code based on our custom dropdown field but this is not working in our instance we tried multiple options its not working can any one guide us what we're missing here ?

 

Not working code for dropdown field (quote_stage_approval_status_c)

 

<?php
$dependencies['Opportunities']['readonly_fields'] = array(
'hooks' => array("edit"),
'trigger' => 'true',
'triggerFields' => array('quote_stage_approval_status_c'),
'onload' => true,
'actions' => array(
array(
'name' => 'ReadOnly',
'params' => array(
'target' => 'total_sqft_rqrd_site_1_c',
'value' => 'equal($quote_stage_approval_status_c,Pending)',
),
),
),
);
?>

Outcomes