The SugarCRM Community is now "read-only" to prepare for the SugarClub launch on August 3. Please visit
Announcing SugarClub - Are you in? for more information.
I want disable edit button for my custom module base on drop-down field.
I Need quick help for this .
I would appreciate all the help you could give me.
I hope you doing good.
Yes in sugarCRM Enterprise that is possible using sugar dependency. I have done this kind of customization.I have share my code with you.Follow the below step.
1.create file in following location './custom/Extension/modules/<module>/Ext/Dependencies/<file>.php' and set module and your condition.
$dependencies['<module>']['<unique name>'] = array(
'hooks' => array("edit"),
//Optional, the trigger for the dependency. Defaults to 'true'.
'trigger' => 'true',
'triggerFields' => array('status'), //dropdown field name
'onload' => true,
//Actions is a list of actions to fire when the trigger is true
'actions' => array(
'name' => 'ReadOnly',
//The parameters passed in will depend on the action type set in 'name'
'params' => array(
'target' => 'edit_button', //edit button name
//id of the label to add the required symbol to
'label' => 'LBL_EDIT_BUTTON_LABEL',
//Set required if the status is closed
'value' => 'equal($status, "Closed")' // base on selected value button will be ReadOnly
//Actions fire if the trigger is false. Optional.
'notActions' => array(),
2.Do Quick Repair and Rebuild.
For more detail check below links.
I hope this will help you.
To disable edit button or any button in recordview .this blog may help you.
How to disable button in sugarcrm dynamically
Thanks Ajay Kumar
Hello Ajay Kumar,
Nice artical but I can see that this code might be not work in Mobile App.Because you write all the code in .js file.
So better is that We should use sugar dependency.
Hi Bhavesh Patel,
I completely agree with you.The code which i have provided wont work for sugar mobile app.
So better we can go with the solution that provided by you.Learned a new thing.
Thanks Bhavesh Patel
Hai Bhavesh Patel,
your code is working for edit button but if i want to disable inline edit also then how to do that ??
Retrieving data ...