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
J.D. DooleyJ.D. Dooley 

What controller do I use/create to display a custom visualforce page on a custom object

My goal is to have a custom object,  NewObject, display embeded youtube videos.
I have created the NewObject.
I have created a visualforce pagem  NewVP  for the videos and it previews fine.
Now I need to add visual force page to the custom object. This is were I am stuck.
I believe I need a custom controll, but am not sure. 
Any support is appreciatd.
Raj VakatiRaj Vakati
Yes you need to use the custome controller extension .. becasue you need to use this page in the Layout ..



Try this code
<apex:page standardController="NewObject__c" extensions="myControllerExtension">
    video URL  as A param pagem  {!pagem  }
</apex:page>
 
public class myControllerExtension {

   public String pagem  {get;set;}
    public myControllerExtension(ApexPages.StandardController stdController) {
     pagem  =ApexPages.currentPage().getParameters().get('pagem ')  ;
    }

    
}

 
J.D. DooleyJ.D. Dooley
<apex:page standardcontroller="Admissions_Support__c " >
  
  <h1>Admissions Support Videos</h1> 
  <br></br>
    <apex:pageBlock title="Lead Reports">
  <iframe title= "Lead Reports" width="560" height="315" src="https://www.youtube.com/embed/6sjoR97vO9I" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="1">
  </iframe>
  </apex:pageblock>
  
  <br></br>
    <apex:pageBlock title="Enrollment Reports">
  <iframe title= "Enrollment Reports" width="560" height="315" src="https://www.youtube.com/embed/o6ByKk66DRk" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="1">
  </iframe>
  
  </apex:pageblock>
  
  <br></br>
    <apex:pageBlock title="Admissions Performance Reports">
  <iframe title= "Admissions Performance Reports" width="560" height="315" src="https://youtube.com/embed/KhOpoBnsTPw?start=6" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="1">
  </iframe>
  
  </apex:pageblock>
  
  <br></br>
    <apex:pageBlock title="Campus Generated Leads Reports">
  <iframe title= "Campus Generated Leads Reports" width="560" height="315" src="https://youtube.com/embed/gH3lgVPf40Y" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="1">
  </iframe>
  
  </apex:pageblock>
  
   <br></br>
    <apex:pageBlock title="Pipeline Reports">
  <iframe title= "Pipeline Reports" width="560" height="315" src="https://youtube.com/embed/T0aclYjquSw" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="1">
  </iframe>
  
  </apex:pageblock>
  
  <br></br>
    <apex:pageBlock title="Start Date Missing Document Reports">
  <iframe title= "SDMDR" width="560" height="315" src="https://www.youtube.com/embed/7jp_cIfm06Q" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="1">
  </iframe>
  
  </apex:pageblock>
  
  
   <br></br>
    <apex:pageBlock title="Show Not Enrolled Reports">
  <iframe title= "Show Not Enrolled Reports" width="560" height="315" src="https://www.youtube.com/embed/7jp_cIfm06Q" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="1">
  </iframe>
  
  </apex:pageblock>
   
 
</apex:page>

This is my current vfpage.
Raj VakatiRaj Vakati
You page looks good.. go to the page layout and add this visualforce page

https://trailhead.salesforce.com/en/content/learn/modules/visualforce_mobile_salesforce1/visualforce_mobile_salesforce1_layouts_cards


From Setup, enter Object Manager in the Quick Find box, then click Object Manager | Account | Page Layouts.
Select Edit from the dropdown arrow to the right of Account Layout.
Select Visualforce Pages and drag the StockQuote page to where you want it displayed on the page.

 
Raj VakatiRaj Vakati
Refer this link 

https://trailhead.salesforce.com/en/content/learn/modules/visualforce_mobile_salesforce1/visualforce_mobile_salesforce1_layouts_cards

Section "
Use the Page on a Page Layout or Mobile Card'
J.D. DooleyJ.D. Dooley
I was able to add it to the pagelayout and it will display, but it is not what I want.When a user selects the tab to the custom object.
When the tab is selected I want the VF page I created to be the first and only thing a user sees.
 
J.D. DooleyJ.D. Dooley
I figured it out. I didnt realize I needed to edit the home page tab and override the standard settings.