Hi
Is the Copy Functionality on a Lead Standard - how can I make it available/unavailable
Hi
Is the Copy Functionality on a Lead Standard - how can I make it available/unavailable
Olivia Forde can you please provide a more detailed question?
Hi Jeff
On Lead there is a menu that includes the ability to Copy a lead but I cannot fins anywhere in Studio to edit this
Doe anyone know how to access the detail/code behind Copy Lead
Hi Olivia Forde ,
The code for the 'Copy' option found in the record view action menu can be found ./custom/modules/Leads/clients/base/views/record/record.php. In the 'buttons' array, you should see code like the following:
10 => array ( 'type' => 'rowaction', 'event' => 'button:duplicate_button:click', 'name' => 'duplicate_button', 'label' => 'LBL_DUPLICATE_BUTTON_LABEL', 'acl_module' => 'Leads', 'acl_action' => 'create', ),
If you want to remove the copy option, then take out that array. If you want to alter the copy behavior (e.g. only copying some fields), then I recommend removing that option and creating a custom action button that uses the 'Copy field values from parent' to selectively choose which fields you want to copy to the new record.
Chris
Super thanks Chris
Are you trying to take away the ability to copy records by user, by module, a combination of both?
By Module you can do as Chris suggested, edit the record.php for the appropriate module in your custom directory and remove that ability for everyone.
If you want to do it per user then you can leverage acl actions, for example changing the
'acl_action' => 'create',
to
'acl_action' => 'admin',
so that only admin users can copy a record.
If you want to get even more refined than that, then you can try to leverage a view controller for additional checks on the User's Role and deny the action, or take it a step further and see if you can extend the examples by Enrico Simonetti here:
https://enricosimonetti.com/powerful-customisations-with-sugars-acl/
FrancescaS