AnsweredAssumed Answered

how to disable edit option for records based on satus closed

Question asked by Ash on Oct 5, 2019
Latest reply on Oct 9, 2019 by Enrico Simonetti

I want to disable edit button and inline edit for records based on status value. how to do that??

Ex: i dont want give an edit option for status closed records. I have tried with this code but it is disabled Edit button only.

how to restrict from inline edit also.

Need help as soon as possible....

 

  1. <?php  
  2.     $dependencies['<module>']['<unique name>'] = array(  
  3.         'hooks' => array("edit"),  
  4.         //Optional, the trigger for the dependency. Defaults to 'true'.  
  5.         'trigger' => 'true',   
  6.         'triggerFields' => array('status'), //dropdown field name   
  7.         'onload' => true,  
  8.         //Actions is a list of actions to fire when the trigger is true  
  9.         'actions' => array(  
  10.             array(  
  11.                 'name' => 'ReadOnly',  
  12.                 //The parameters passed in will depend on the action type set in 'name'  
  13.                 'params' => array(  
  14.                     'target' => 'edit_button'//edit button name  
  15.                     //id of the label to add the required symbol to  
  16.                     'label' => 'LBL_EDIT_BUTTON_LABEL',  
  17.                     //Set required if the status is closed  
  18.                     'value' => 'equal($status, "Closed")' // base on selected value button will be ReadOnly  
  19.                 )  
  20.             ),  
  21.         ),  
  22.         //Actions fire if the trigger is false. Optional.  
  23.         'notActions' => array(),  
  24.     );  

Outcomes