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
Tara DunlopTara Dunlop 

How is a VF code for changing the initial page for the Products tab?

Hi all,

I am using the standard Products object. Whenever I go to the Products tab, it leads me to an initial page layout where the Assets view, Price List view is displayed, what I don't need for this.

Is there any form to get rid of these lists/views?. I only would like to have there the recent products, nothing else.

I would appreciate your answers.
DeveloperSudDeveloperSud
Hi Tara,

You cannot change the detail page layout of product object with standard customization but this is possible with Visualforce page.You can follow the steps below:
Step 1: Create a Visualforce page with below code.
<apex:page action="{!URLFOR($Action.Product2.List, $ObjectType.Product2)}">  
</apex:page>

Step 2: Go to Customize->Products->Buttons and Links
Edit the "Products Tab"
Under the Override Properties section, for "Override With" property ,select the visualforce page name which you have creted in step 1.

step 3: Create a new 'View' for 'Recent Products' , for that  just use the below filter criteria.
Created Date Equals Today OR Last Modified Date Equals Today.You can set the time according to your choice.I just tested with the product 
records creted on today's date only.

Please confirm if this is helpfull to you.Thanks!!!.
 
Tara DunlopTara Dunlop
Thanks DeveloperSud. I followed the steps and whenever I click the tab Products it leads me to the All Products list view, ok, but what about if I want to add the "Search Product" Section and the Reports Section in it?. How to do it in Visualforce?