You need to sign in to do that
Don't have an account?
Corey Edwards 11
Save and New Button keeps previous field values
Hi Guys,
I've created a Visualforce page which allows users to create quotes for customers. I want to create functionality which allows the user to adjust field values, click 'Save and New' and retain existing field values and create a new quote based on this.
I can currently implement 'Save and new' functionality quite easily using:
Any help would be greatly appreciated.
Cheers,
Corey
I've created a Visualforce page which allows users to create quotes for customers. I want to create functionality which allows the user to adjust field values, click 'Save and New' and retain existing field values and create a new quote based on this.
I can currently implement 'Save and new' functionality quite easily using:
public PageRedoSaveAndNew() { m_sc.save(); PageReference pageRef = new PageReference(ApexPages.currentPage().getUrl()); pageRef.setRedirect(true); return pageRef; }I was hoping setting the Page Reference to the current page would help but it's not working.
Any help would be greatly appreciated.
Cheers,
Corey
try this code
public PageRedoSaveAndNew() { m_sc.save(); PageReference pageRef = new PageReference(ApexPages.currentPage().getUrl()); pageRef.setRedirect(true); return pageRef; }
m_sc = new <StandardControllerObject>() ;
This code isn't working. It's giving me an error: Error: Compile Error: unexpected token: '=' at line 20 column 5
Here is my full code to review. Any help would be great :)
This is with your alterations.
Cheers
Use this code ,
global with sharing class AuthCalloutExtension {
ApexPages.standardController m_sc = null;
public Quote quo { get; private set; }
private String queryString;
public AuthCalloutExtension (ApexPages.standardController sc)
{
m_sc = sc;
if(sc.getRecord()!=null)
quo = (Quote)sc.getRecord();
else
quo = new Quote();
}
public PageReference SaveAndNew()
{ m_sc.save();
PageReference pageRef = new PageReference(ApexPages.currentPage().getUrl());
pageRef.setRedirect(true);
quo =new Quote();
return pageRef;
}
}
Thanks for your response. The quote is saved and the parameters are being passed to the URL but they arn't populating the fields.
Do you know how to populate the fields using the URL parameters?
Cheers