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
Lionel KamdemLionel Kamdem 

Add Recent Opportunity View To List View

Hi 

I am looking to add a recent opportunity view to custom visual force page I created for a list view. 

The reason why I made the custom visual force page was to get rid of the new opportunity button, but I am looking to add a recent opportunity view. 

This is the current code I have for the visual force page: 

<apex:page showHeader="true" tabstyle="Opportunity" lightningStyleSheets="true">
  <!-- Begin Default Content REMOVE THIS -->
   <apex:ListViews type="Opportunity" />
   
   SELECT Id, Name FROM RecentlyViewed  WHERE Type ='Opportunity' ORDER BY
  LastViewedDate DESC
    
  <!-- End Default Content REMOVE THIS -->
</apex:page>

How would I go about adding a recent opportunity view to this? 

This is the image as well of what it looks like:

Oppty Visual Force Page
ShirishaShirisha (Salesforce Developers) 
Hi Lionel,

Greetings!

Unfortunately,you can't override or edit the Recently viewed List view and we have an existing idea created fori the same.

https://trailblazer.salesforce.com/ideaview?id=08730000000BpRoAAK

Idea to not able to remove the New button on the Listview as below:
https://trailblazer.salesforce.com/ideaView?id=0873A0000003eSaQAI

So,the only workaround is to override the New button and disply some text like they can't create the new record from there.

Please mark it as best answer if it helps you to fix the issue.

Thank you!

Regards,
Shirisha Pathuri