You need to sign in to do that
Don't have an account?
Zen Newman 1
Having trouble creating a create opportunity Visualforce page
Hello, fairly new to Visualforce. I'm trying to create a Visualforce page to replace the default create new opportunity page. The code I used came from a similar new account page which is working. I'm seeing no warrnings in the developer console and the page displays fine, but when I click the save button, no record is created and when I click the cancel button, it flags required fields as needing to be filled out to move forward. Can someone tell me where I'm going wrong? Thank you!
<apex:page standardController="Opportunity" lightningStylesheets="TRUE" showHeader="TRUE" docType="html-5.0"> <apex:SectionHeader title="New Opportunity"> <apex:form > <apex:pageBlock title="Add Opportunity" mode="edit"> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save"/> <apex:commandButton action="{!cancel}" value="Cancel" immediate="true"/> </apex:pageBlockButtons> <apex:pageBlockSection > <apex:inputField value="{!Opportunity.Name}" /> <apex:inputField value="{!Opportunity.AccountId}" /> <apex:inputField value="{!Opportunity.Stagename}" /> <apex:inputField type="date" showDatePicker="TRUE" value="{!Opportunity.CloseDate}" required="TRUE" /> <apex:inputField type="date" showDatePicker="TRUE" value="{!Opportunity.Project_Launch_Date__c}" required="TRUE" /> <apex:inputField value="{!Opportunity.Broker_Account__c}" /> <apex:inputField value="{!Opportunity.Broker_Contact__c}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:SectionHeader> </apex:page>
Please try below Code:
All Answers
Please try below Code: