Showing posts with label Utility. Show all posts
Showing posts with label Utility. Show all posts

Thursday, September 9, 2021

Remove "Change Owner" Quick Action from List Views in Lightning

Hello There,
 

Have you tried removing the "Change Owner" quick action on List Views? tricky isn't it?

We also have an open Idea in our Salesforce IdeaExchange community: 

Currently with out-of-box settings, it is not allowed to remove/hide this quick action on list views and removing the change owner permission at profile level has its own consequences.


It is quite understood that in many business cases, we want to limit the ownership transfer. However, the above limitation comes as a loop hole.


Here is a workaround to get rid-off the "Change Owner" button on list-view using a Utility-Bar.  This process makes use of CSS to hide the Change Owner which gets loaded from an LWC present inside Utility Bar.  Let's understand the procedure of getting rid-off the "Change Owner".


Pre-Requisites :

  • Utility bar is required to be present to be present.

Steps :
  • Install the below managed package in your Salesforce org.
    • For Sandbox  - Link
    • For Production  - Link

  • After successful installation, copy the API Name of the object for which the "Change Owner" button needs to be removed on list-views and add it to the custom label "Object_Names_to_hide_Change_Onwer". 

[For multiple objects, add them into the custom label by separating them with a comma (',') operator.  If this has to be implemented for All the tabs, mention as ALL in the custom label].
  • Goto Setup > App Manager and edit the app in which the tab is present.  
    • Now click on "Utility Items" on the left side pane.
    • Click on "Add Utility Item", search for "hideOwner" and add it.
    • You can leave the label as-is or can modify it as per your need.  If you do not want to have any label, just leave with a dot "." as this is required value.
    • Remember to check the checkbox "Start Automatically" at the bottom and click on "Save"

  • Repeat the above step for different apps where the Object tab is present.  
  • Now navigate to the tab and the "Change Owner" quick action is gone! 



You can contact me via LinkedIN for any issues while using / installing package.  Thanks for being an awesome reader and feedback is much appreciated.  

..BazingaaaA..