You need to sign in to do that
Don't have an account?
Anjaneylu
SaveandNew method for standard Controller
HI friends,
My Question is can we implement the SaveandNew method in standard controller ?
if Yes,
Then Help me in this scenario..
<apex:page standardController="Account">
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Save and new" action="{!SaveAndNew}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Account information">
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Then it is raising the error like
[Error] Error: Unknown method 'AccountStandardController.SaveAndNew()'
Thanks and regards,
Anji
My Question is can we implement the SaveandNew method in standard controller ?
if Yes,
Then Help me in this scenario..
<apex:page standardController="Account">
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Save and new" action="{!SaveAndNew}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Account information">
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Then it is raising the error like
[Error] Error: Unknown method 'AccountStandardController.SaveAndNew()'
Thanks and regards,
Anji
SaveAndNew method is not there in standard controller .You can achieve this by creating custom method where you can save the record and reload the same page instead of redirecing to the record detail page .
For more details about the standard controller method you can check below link.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/apex_ApexPages_StandardController_methods.htm
Let me know if it helps
Thanks
Manoj
Saveandnew method is not available standard controller better can do extension method inside dml insert and clear example i given to you
Extension
public Account acc{get;set;}
public void saveAndNew(){
insert acc;
acc.clear();
}
Regards
Eswar Prasad