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
Leah MorganLeah Morgan 

hide action column

Hello,

I am tryig to hide the action column for cases on my related lists.  
example
We use ServiceMax and users are required to modify cases via the servicemax SFMs, not the default salesforce links.  I found this bit of code:
<style type="text/css">
.actionColumn {display:none; visibility:hidden}
</style>
In a different spot on the forums.  I'm not sure if this would serve my purpose however, and even if it would, I'm not sure where I would put it.  I want the change to affect ALL related lists, and I don't mind if it is applied to all users, although I would prefer it to be on a profile basis.

Any help would be greatly appreciated, thank you!

Leah
 
Best Answer chosen by Leah Morgan
RbnRbn
Hi Leah Morgan,

You can paste the below code in your existing vf page itself.

All you need is the below line of code to be pasted after your apex:page tag.

<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"/>
 <script>
$(".actionColumn").css("display","none");
</script>

If you got any problem in doing so, do paste the code, it would be easy for me to debug further.

Regards,
Rabindranath

All Answers

RbnRbn
Hi Leah Brooks,

It is not possible to remove the action column from the related list through standard options.

For this you need to design your own visualforce page .

Already for the same functionality, we have an idea posted 4 years  back.

https://success.salesforce.com/ideaView?id=08730000000ksRdAAI#

Regards,
Rabindranath
RbnRbn
Another way of handling this requirement is at Profile Level.

 If you make the Edit & Delete Checkbox unchecked at the Profile level, it will disable this particular edit and delete link.

Go to Profiles - Select the desired Profiles - Naavigate to object Settings- Edit - There you will find out checkboxes(Read,Write,Edit,Delete) - Uncheck the edit & Delete Checkbox

User-added image

Mark it as solved if it answere your query.

Regrds,
Rabindranath
Leah MorganLeah Morgan
@rabindrath, thank you for your response!

I am aware that I will need to use a VF page to achieve this.  I am already using VF pages as the landing pages for all of my object in order to hide the 'recent' view. (This had a non-removable 'New' button on it, which nessecitated using the VF page to hide it)

If I am able to utilize this pre-exsisting code to remove the 'Actions' column that would be amazing.  I am not a well versed programmer however, so I am not sure where to start.  If anyone has any suggestions for me on how to construct this VF page it would be greatly appreciated!

Leah
RbnRbn
Hi Leah Brooks,

Please find the below code snippet which helps in removing the action column
<apex:page tabStyle="Case">

<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"/>

<apex:sectionHeader title="Case" subTitle="Home" />
<apex:pageMessages />

    <apex:ListViews type="Case" />

<script>
    // Using jQuery, hide all of the actionLinks (edit link specifically) on the Case   
    $(".actionColumn").css("display","none");
</script>

</apex:page>

On execution of above code, below would be the result :

User-added image

Do let me know if you require any further help on this.

Regards,
Rabindranath
Leah MorganLeah Morgan
THank you @rabindranath, that is exectly what I need.  Another question though, and this might be a very simple one: where do I put that code?  Do I create a new VF page?  Should I add it to the custom page I have already made?

Thanks again!
RbnRbn
Hi Leah Morgan,

You can paste the below code in your existing vf page itself.

All you need is the below line of code to be pasted after your apex:page tag.

<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"/>
 <script>
$(".actionColumn").css("display","none");
</script>

If you got any problem in doing so, do paste the code, it would be easy for me to debug further.

Regards,
Rabindranath
This was selected as the best answer
Leah MorganLeah Morgan
Here is the code that I already have:
 
<apex:page action="{!URLFOR($Action.Case.List, $ObjectType.Case)}"/>

This is just removing the 'recents' view and sending the user directly to their last viewed list view.  I tried adding the code you provided within the brackets, and outside of them and I recieved an error both times saying that the code was not well formed.
RbnRbn
Hi Leah,  

If you can post the code and the error recieved, it would be helpful in debugging further.

Regards
Rabi
Leah MorganLeah Morgan
Here is the code:
 
<apex:page action="{!URLFOR($Action.Case.List, $ObjectType.Case)}"/>
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"/>
 <script>
$(".actionColumn").css("display","none");
</script>

And here is the error:

Error: CasesHome line 2, column 2: The markup in the document following the root element must be well-formed
Error: The markup in the document following the root element must be well-formed.
RbnRbn
Hi Leah,

in the first line you should not close the apex:page tag with />
remove the " / "

Regards,
Rabindranath
Leah MorganLeah Morgan
Oh wow, thank you, I fixed it and it is now letting me save, but nothing is happening to my cases page.  Hereis the code:
 
<apex:page action="{!URLFOR($Action.Case.List, $ObjectType.Case)}">
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"/>
 <script>
$(".actionColumn").css("display","none");
</script>
</apex:page>

 
RbnRbn
Glad that it resolved the issue.

But what exactly are you trying to do.Because your initial requirement was to hide the Action column .and thats what the bove piece of code does.

Let me know your requirement in detail to code it from scratch.
 
Leah MorganLeah Morgan
I am trying to hide the action column, that is correct.  Here is a screenshot of my cases page however with the updated code in place:

User-added image

Nothing is happening.
RbnRbn
Hi Leah,

Instead of action tag if you make use of the below apex code in the first line, it serves the purpose.

<apex:page tabStyle="Case">

Let me know if it resolves it.

Regards,
Rabindranath
Leah MorganLeah Morgan
I took out the action tag and added the 'tabStyle' tag instead and then the page wouldn't load:

User-added image
RbnRbn
Okie no worries, will try out in my dev org and will post back to you once done.

regards,
rabi
Leah MorganLeah Morgan
thank you!! :)
RbnRbn
Hi Leah,

It would be great if we can get over a GTM and debug this issue.Since replicating the issue in my instance is quite difficult.

Do share me your email address and will take it from there.

Regards,
Rabindranath
Leah MorganLeah Morgan
@rabindranath.  My email is leah.brooks.ext(at)bayer.com.
Leah MorganLeah Morgan
Thank you so much for your help @rabindranath!  It is working well now!  For everyone's reference, what I wound up doing was creating a VF page that I redirected the 'Cases' tab to, and pasting the below code into it:
 
<apex:page tabStyle="Case" >
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"/>
<apex:sectionHeader title="Case" subTitle="Home" />
<apex:pageMessages />
<apex:ListViews type="Case" />
<script>
$(".actionColumn").css("display","none");
</script>
</apex:page>

 
Stephen Cormier 5Stephen Cormier 5
Hi, all. 

Could this be applied to the alphabet shortcuts on a custom list view? If yes, how so?
Thank you very much ! 

Stephen