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
chantspelchantspel 

Leverage standard controller save action

Hi,

I am trying to overide the default edit page for my custom object but not having much luck. I think this code is pretty self explanatory, but when I click the save button - the record does not update or get saved...

 

 

<apex:page standardController="CustomObj__c" showHeader="true">
<apex:pageBlock >
<apex:form >
<apex:commandButton value="Save" action="{!save}"/>
<apex:inputText value="{!CustomObj__c.CustomObjValue__c}" size="50" />
</apex:form>
</apex:pageBlock>
</apex:page>

 

Is there something else I need to do to take the input and save it? I'd rather not have to write a controller for such a simple thing. Thanks

 

EIE50EIE50

Hi there,

 

I tried the same code with standard controller (account), this worked for me.

 

 

<apex:page standardController="account" showHeader="true"> 
  <apex:form > 
   <apex:pageBlock mode="edit"> 
   <apex:commandButton value="Save" action="{!save}"/>        
    <apex:inputText value="{!account.name}" size="50" /> 
   </apex:pageBlock>
  </apex:form>
</apex:page>

 Thanks.