Hi,
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.
Hi,
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.
Hi Paulm,
To disable edit button or any button in recordview .this blog may help you.
Hello paulm,
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.
<?php $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( 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.
-BPATEL
Thanks Ajay Kumar
Thanks Bhavesh Patel
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 ??
Can we do this for email property buttons like primary mail