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
RRRizeRRRize 

Visualforce page implementation question...

Greetings.  I asked the Java developer in my org to create a Visualforce page that would contain a few lookup fields and a few custom fields.  The objective is to embed the page into the Opportunities page.  We managed to do this but have the following problems:

 

1. When a new Opportunity is created, the Visualforce page does not appear in the Opportunity until after the Opportunity is saved.

2. When the Visualforce appears (after the Opportunity is saved) it appears in edit mode while the Opportunity page is not in edit mode.

3. I cannot save any data in the Visualforce page.

 

We would like for the Visualforce page to appear in the Opportunity immediately as the Opportunity is created and be able to enter data in it while at the same time being able to enter data into the standard Opportunity fields.

 

Any hints or insight on what we need to do to make this happen will be hugely appreciated.  Thanks in advance!

Bhawani SharmaBhawani Sharma

Hi Ron,

 

You need to create a Visualforce page having Opportunity as an standard controller.You can do the following :

 

<apex:page standardController="Opportunity" >

<apex:form>

<apex:sectionHeader title="Opportunity" />

 

<apex:pageBlock title="Edit Opportunity">

<apex:pageBlockButton>

<apex:commandButton action="{!Save}" value="Save" />

<apex:commandButton action="{!cancel}" value="Cancel" />

</apex:pageBlockButton>

 

<apex:pageBlockSection title="general">

<ape:inputField value="{!Opportunity.Name}" />

<!-- define the other fields in same format -->

</apex:pageBlockSection>

</apex:pageBlock>

 

<apex:form>

</apex:page>

 

Now override Opportunity New and Edit view with this visualforce page.

 

So now whenever you will click on the New or Edit opportunity button this page will be displayed.

RRRizeRRRize

Thanks so much, but not sure I understand totally.  We already have the Opportunity as a standard controller.  How actually can we override the New and Edit view with the VF page?

Bhawani SharmaBhawani Sharma

Follow this path :

 

SetUp -> App Set up -> Customize -> Opportunities ->  Buttons and Links

Now you will get the Edit and New Button here.

Click on the Edit link against New and Edit button and override with your visualforce page.