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
TeddyAbleTeddyAble 

Overwrite Standard View with Visualforce

Hello guys,

 

 

I have created a visualforce page and will like to overight the standard view with the visualforce page.. but when i go to the "Override Standard Button or Link"

My Visualforce page isnt visible is not part of the list of Visualforce pages in the "New" section of Override Standard Button or Link.

 

The controller calls multiple object Standard and custom object  this enables the field be visible in the visualforce page

 

Visualforce Page
==============================================================


<apex:page standardController="adviser__C" extensions="A1">

<apex:sectionHeader title="Institution" subtitle="{!a.name}"/>
<apex:form >
<apex:pageBlock title="Create New Institution" id="thePageBlock" mode="new">
<apex:pageMessages />

<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton action="{!cancel}" value="Cancel" onclick="return confirmCancel()" immediate="true"/>

</apex:pageBlockButtons>

<apex:pageBlockSection title="General Information" columns="2">
<apex:inputField value="{!a.name}" required="true"/> </apex:pageBlockSection>

</apex:pageBlock>


</apex:form>
</apex:page>
===============================================================

 

Controller

 

Adviser__c is a custom object .

===============================================================

 

public class A1 {

public A1()
{
a=new adviser__c();
b=new contact();
c=new account();

}

Public Adviser__c a {get;set;}
public contact b {get;set;}
public account c {get;set;}


public pageReference Save()

{
insert c;
b.Account__c=c.id;
a.Name=c.name;

insert b;
a.Contact__c=b.id;
a.Name=b.FirstName+' '+b.LastName;

insert a;
b.Adviser__c=a.id;

update b;
pageReference pref=New Pagereference(URL.getSalesforceBaseUrl().toExternalForm()+'/apex/AdviserView?id='+a.id);


return pref;
}

public pageReference Cancel()
{
return page.AdviserView;
}


}
===========================================================

 

 

Any help will be highly appreciated.

 

Regards,
TeddyAble

Best Answer chosen by Admin (Salesforce Developers) 
SRKSRK

I belive u r Override Standard Button or Link of adviser__c object  

also in u r VF page standardController="adviser__C"  try to chage that C into small c standardController="adviser__c" & also give ID to u page & make sure that this VF page is saved

All Answers

SRKSRK

I belive u r Override Standard Button or Link of adviser__c object  

also in u r VF page standardController="adviser__C"  try to chage that C into small c standardController="adviser__c" & also give ID to u page & make sure that this VF page is saved

This was selected as the best answer
Abhay AroraAbhay Arora

just change 

 

adviser__C

 

to

 

adviser__c

 

it will fix your issue

SRKSRK

Mark it solve it will he helpful for others

Chamil MadusankaChamil Madusanka

What is the object you are going to overwrite? If it is Adviser__c , then it is ok. when you r going to overwrite standard button or link that visualforce page's standard controller must be the object which related to that overridden button.

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

TeddyAbleTeddyAble

Hey Guys

Thanks for your feedback

 

 

Regards,