Important Update: Some Community URL Redirects are Under Maintenance. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable/Hide 'Copy' menu item

jacquelineb
Contributor II

I'm looking for custom code to disable or hide the menu item 'copy'.  I do see several posts where others are looking for the same functionality.  In my previous role, I do know that this was accomplished but I believe the code lived on the server, making it a platform-wide hide.  Is anyone aware of how this might be accomplished?  If not, is there custom code that will disable it in each app/questionnaire?  I'm on 6.10.

Thank you in advance!

Jacqueline 

6 REPLIES 6

JordanG
Collaborator III

Dont believe theres a way to do system wide (at least that I'm aware of, maybe if you're on-prem you can do special stuff). We just use a custom object in our apps we dont want users to ever copy from. This eliminates most scenarios of accidental copying, but users can still do it from reports.

I tried finding the post where I actually found this code, but the few that I managed to find about this all have something slightly different. We use:

<script type="text/javascript">
$('#master_btnCopy').hide();
$('.rmText:Contains("Copy")').closest('li').remove();
</script>

 This removes the button both from the menu from clicking the ellipses and from right clicking the key field top left.

Thank you, Jordan.  I did find this code and am able to hide those instances of copy while in the record.  However, in a search result, you can right-click on the record number there to copy.  Do you know of a way to handle this as well?

 

Menu Item Copy.png

I'm not aware of any way to turn it off from a report/search sadly. I wouldn't think its possible on a hosted/SaaS environment. On Prem may be different but feel like you'd really need a bespoke solution. Only true solution is getting Archer to implement it themselves.

We add the following JavaScript to Record.aspx and Search.aspx to remove the detached context menu altogether.

$(document).ready(function () {
if ($('#master_DefaultContent_contextMenu_detached').length > 0)
{
$('#master_DefaultContent_contextMenu_detached').remove();
}
});

ManuelDEOLIVEIR
Contributor II

Add this code in the Search.aspx :

             $(document).ready(function () {
                    var menu = document.getElementById('master_DefaultContent_contextMenu_detached');
                    if (menu != null)
                    {
                          var childAs = menu.getElementsByTagName('a');
                          for( i=0; i < childAs.length; i++ )
                          {
                                 var childA = childAs[i];
                                 if(childA.getAttribute('onclick').includes('copyRecord'))
                                 {
                                       childA.remove();
                                 }

                          }
                    }
             });