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
Dutta SouravDutta Sourav 

Web to Opportunity Form

Is it possible to store Opportunity from Website?
Like "Web-to-Lead", Opportunity needs to be stored.
Any Idea?

Thanks in Advance.  
Chandra Sekhar CH N VChandra Sekhar CH N V
Just code a simple VF page with opportunity standard controller and publish the form in the website.
Dutta SouravDutta Sourav

Hi Chandra Sekhar,
Thanks a lot for your response.
Can you please elaborate more? 

Thanks & Regards,
Sourav

Chandra Sekhar CH N VChandra Sekhar CH N V
Create a visualforce page with standard controller as "opportunity" and include whatever inputfields from the object which you want to give as input on the form. Use standard Save action which will automatically create the record for you.

In case you have site already published in your salesforce org, include this visualforce page as well in the site. 

Posting sample code below: 
<apex:page standardController="obj">
    <apex:form >
        <apex:pageBlock >
             <apex:pageBlockSection >
     <apex:inputField value="{!obj.field1}"/>
     <apex:inputField value="{!obj.field2}"/>
     .............
     <apex:commandButton action="{!save}" value="Save"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>        
</apex:page>

 
Dutta SouravDutta Sourav
Thank you so much Chandra Sekhar.

This is the code to create VF Page. 
How to add this in an HTML Page?
Opportunities need to be gathered from website.

Thanks & Regards,
Sourav
Chandra Sekhar CH N VChandra Sekhar CH N V
What is your website home page? Is it an custome page(html/VF) ?

Just embed this within home page or make it an event dependent one (like on button click open the form etc...)
Dutta SouravDutta Sourav
Thanks again Chandra Sekhar.

Our Website Homepage is HTML Page.
How can I embed my VF Page with the Website Homepage?

Thanks & Regards,
Sourav
 
Chandra Sekhar CH N VChandra Sekhar CH N V
What i meant was just include this VF code within the HTML code so that your site page will contain this opportunity form as well.