You need to sign in to do that
Don't have an account?
Hemalatha Paruchuri
Hi , I am override Standrd Opportunity Object with Some New section ..but my save method is not working
Please see below code
<apex:page standardcontroller="Opportunity" extensions="TestOpportunityCLS">
<apex:form >
<apex:pageblock >
<apex:pageblockButtons >
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandbutton value="Edit" action="{!Edit}"/>
<apex:commandbutton value="Cancel" action="{!Cancel}"/>
</apex:pageblockButtons>
<apex:pageblock title="Opportunity Edit" >
<apex:pageblockSection title="Opportunity Information">
<apex:outputField value="{!Opportunity.ownerId}"/>
<apex:inputField value="{!opportunity.AccountId}"/>
<apex:inputField value="{!opportunity.Name}"/>
<apex:inputField value="{!opportunity.Stagename}"/>
<apex:inputField value="{!opportunity.closedate}"/>
</apex:pageblockSection>
</apex:pageblock>
<apex:pageblocksection title="Select Products">
<apex:inputfield value="{!Opportunity.Pricebook2.Room__c}"/>
<apex:outputfield value="{!Opportunity.Product__r.Total_in_Units__c}"/>
<apex:inputfield value="{!Opportunity.Product__c }"/>
<apex:outputfield value="{!Opportunity.Product__r.UOM__c}"/>
<apex:inputfield value="{!Opportunity.Product__r.Length__c}"/>
<apex:inputfield value="{!Opportunity.Product__r.Width__c}"/>
<apex:outputfield value="{!Opportunity.Product__r.Cleaning_cost__c}"/>
<apex:outputfield value="{!Opportunity.Product__r.FS_Cost__c}"/>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
<apex:page standardcontroller="Opportunity" extensions="TestOpportunityCLS">
<apex:form >
<apex:pageblock >
<apex:pageblockButtons >
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandbutton value="Edit" action="{!Edit}"/>
<apex:commandbutton value="Cancel" action="{!Cancel}"/>
</apex:pageblockButtons>
<apex:pageblock title="Opportunity Edit" >
<apex:pageblockSection title="Opportunity Information">
<apex:outputField value="{!Opportunity.ownerId}"/>
<apex:inputField value="{!opportunity.AccountId}"/>
<apex:inputField value="{!opportunity.Name}"/>
<apex:inputField value="{!opportunity.Stagename}"/>
<apex:inputField value="{!opportunity.closedate}"/>
</apex:pageblockSection>
</apex:pageblock>
<apex:pageblocksection title="Select Products">
<apex:inputfield value="{!Opportunity.Pricebook2.Room__c}"/>
<apex:outputfield value="{!Opportunity.Product__r.Total_in_Units__c}"/>
<apex:inputfield value="{!Opportunity.Product__c }"/>
<apex:outputfield value="{!Opportunity.Product__r.UOM__c}"/>
<apex:inputfield value="{!Opportunity.Product__r.Length__c}"/>
<apex:inputfield value="{!Opportunity.Product__r.Width__c}"/>
<apex:outputfield value="{!Opportunity.Product__r.Cleaning_cost__c}"/>
<apex:outputfield value="{!Opportunity.Product__r.FS_Cost__c}"/>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
try this is working, it will redirect to record detail page once it is saved, it will not be in edit mode.