function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RArunrajRArunraj 

How to remove the Related List Action Column

Hi,

 

After removing the object level edit and delete permission from the profile. Still I am able to see the Action column in the related list. Is there is any way to remove this Action column?

Bhawani SharmaBhawani Sharma

You need to create a home page component , from where through the javascript  you can hide these link.

RArunrajRArunraj

Yes, we can hide the Action column through home page component, but I need to hide the action column based on the profile. But in the Home page component we are not able to get the logged in user profile id using  {!$user.profileid}, So how we can achieve this based on the profile using home page component.

Bhawani SharmaBhawani Sharma

Yoc can create a visualforce page and can put it as iframe  in home page component.

RArunrajRArunraj

I am able to hide the action column through home page component. But I am facing one more problem Whenever I clicks the Show 3 More link in the related list, once again the Action link is getting displayed because of the partial refresh of that particular related list alone. So can you help me to hide the action column when the show more link is created in the related list.

 

Thanks,

MrudulaMrudula

Im facing the same issue but unable to access the related list through home page component.could please share the script code..

 

Thanks

amruta_dhumalamruta_dhumal

I am also facing this same issue,can anyone pls share the code.how to remove Action column from related list?

help would be appreciated

ShrutiShruti

Hi,

 

When I am creating a Visualforce page and adding it to my Home page component, the domain of the VF apge (c.ap1) and the domain of the Salesforce page(ap1) differes and it is not able to recognize the parent's page 'Action'.Please help in resolving this issue.

 

Thanks,

Shruti

Bhawani SharmaBhawani Sharma

Hi Shruti,

 

Instead of visualforce page, can javascript serve your purpose?

 

ShrutiShruti

Hi Bhawani,

 

I tried using javscript and then finding out the Profile id using the gloabl variable {!$.Profile.Id} and also by calling apex class to  find the profile id. But it does not return any value for both of them.

 

Can you please tell me how should I get the value in Javascript?

PrashanthNeoPrashanthNeo

Hi, 
you can remove the action column by adding following code anywhere in the VF page,

<style type="text/css">
.actionColumn {display:none; visibility:hidden}
</style>

 

here we are setting the display and visibility properties in CSS 
thanks to 
smrkepware (Contributor) for this code.

Regards,
Prashanth

KRayKRay
To build upon PrashanthNeo's last comment. Salesforce please mark his/her answer as the best!!!!!

After you've removed the "edit" and "delete" object level permission, a blank "action column" will stil appear. It's not the end of the world but the Client/Business may not be a fan of it being displayed.  Your best option is to use the descendant selector, see link for more details http://css-tricks.com/almanac/selectors/d/descendant/

Example:
Let's say that you have more that one related list but you only want to hide the action colum on the second list. 
  1. Wrap/nest the related list in a div and assign it a class. e.g. div class ="CustomObject2
  2. Using PrashanthNeo's example in conjuction with the descendant selector, you can zero in on a specific list.  e.g. div.CustomObject2 .actionColumn . In plain english, it'll assign the css styling to any "action column" that's a descendant of the "CustomObject2" div. 
I hope this helps. 
<apex:relatedList list="customObject1__r"  title="Custom Object 1"/> 

<div class ="CustomObject2"
       <apex:relatedList list="customObject2__r" title="Custom Object 2"/> 
</div>

<apex:relatedList list="customObject3__r" title="Custom Object 3"/> 

<style type="text/css">
div.CustomObject2 .actionColumn{
          display:none; 
           visibility:hidden 
} </style>


 
DhrumitDhrumit

Hide Action Link (Edit | Del) from Related list and add chatterFeed using same vf page on Account Object

https://salesforceforlightning.com/blog/salesforce-coding-guide/hide-action-links-from-related-list-and-add-chatter-feed-from-vf-page