locked
How to hide the Actions Menu Deactivate for the Entities homepage? RRS feed

  • Question

  • I can hide the menu item (Actions ->Deactivate) on a entity form for a Security Role using jScript on the onLoad event, but what method is there for hiding the same menu item on the Entities page also. Tried doing this thru the sitemap but I failed to get anything to work. An Entity example would be Account. 

    Also although I can use the Security Role settings to prevent Deletion by Security Role, I don't think anything applies with Deactivation if the Security Role has the right to modify Account record.

    Tuesday, August 10, 2010 7:53 PM

Answers

  • Solution:

    The goal was to hide the Deactivate Menu Item for a custom Entity based on the Security Role of the user logged into CRM.
    Tested using Security Role settings for both the custom Entity and also the Core records that had a relationship to the custom Entity. Both of these methods failed to produce the needed results do to the privilege restrictions that restricted the user from modifying data that they still access to.

    There were three places that the Deactivate Menu Item needed to be removed, all under More Actions.

    1.       Homepage

    2.       Advanced Find

    3.       Custom Entity’s Form

    I accomplished my goal by adding jScript that did a lookup for the user Security Role and then did the hide Deactivate Menu Item if the user did not have permission to Deactivate the record. I added this code to three locations, two unsupported and one supported.

    1.       Homepage.aspx (unsupported)

    2.       Custom Entity’s Form onLoad Event (supported)

    3.       fetchData.aspx (unsupported)

    I am sure there is probably a better way to accomplish what I set out to do, but the above is the method I used. Be aware that two of the places I added the code are unsupported by Microsoft and could break when upgrades and Rollups are applied that might replace or modify those two files.

    Friday, August 27, 2010 2:56 PM

All replies

  • Tuesday, August 10, 2010 8:28 PM
    Moderator
  • Thank you for the help, I really appreciate it. I will give it a try in the morning, it looks like it will work great for me.
    Wednesday, August 11, 2010 12:49 AM
  • Andriy,

    Your suggestion worked great!!

    Thanks Again

    Wednesday, August 11, 2010 6:41 PM
  • Just realized that I left visable the menu item Deactivate when the user does an Advance Find. Everything was working  great with suggestion up until then. So now I wondering if there is a way to just change the deactivate funtion when the open CRM based on their Security Role. Any ideas or suggestions?

    Thursday, August 19, 2010 7:26 PM
  • you can do this in supported way,but you can try to inject JS on homepage.aspx, to check currrent user and do the same, But this will be a unsupported, and not recommended


    Mahain : http://mahenderpal.wordpress.com
    Friday, August 20, 2010 3:45 AM
    Moderator
  • What is the supported way? I may be having brain lock and just over thinking what I am trying to accomplish.

    I did do the homepage.aspx injection and also I did the same for the forms onLoad event, which both worked. But now I've found out that the Deactivate still shows up in an Advanced find view. Not sure which aspx I should add my code to take care of the Advance Find views.

    Friday, August 20, 2010 12:26 PM
  • Andriy,

    Do you know which aspx creates the More Actions ->Deactivate in an Advance Find View?

    Monday, August 23, 2010 12:48 PM
  • Solution:

    The goal was to hide the Deactivate Menu Item for a custom Entity based on the Security Role of the user logged into CRM.
    Tested using Security Role settings for both the custom Entity and also the Core records that had a relationship to the custom Entity. Both of these methods failed to produce the needed results do to the privilege restrictions that restricted the user from modifying data that they still access to.

    There were three places that the Deactivate Menu Item needed to be removed, all under More Actions.

    1.       Homepage

    2.       Advanced Find

    3.       Custom Entity’s Form

    I accomplished my goal by adding jScript that did a lookup for the user Security Role and then did the hide Deactivate Menu Item if the user did not have permission to Deactivate the record. I added this code to three locations, two unsupported and one supported.

    1.       Homepage.aspx (unsupported)

    2.       Custom Entity’s Form onLoad Event (supported)

    3.       fetchData.aspx (unsupported)

    I am sure there is probably a better way to accomplish what I set out to do, but the above is the method I used. Be aware that two of the places I added the code are unsupported by Microsoft and could break when upgrades and Rollups are applied that might replace or modify those two files.

    Friday, August 27, 2010 2:56 PM