You need to sign in to do that
Don't have an account?
Pamela Lauw
Prefill Close Date on New Opportunity
I've created a VF page and controller to override the standard "new" button on the Opportunity Home Page. The intention is to pre-fill the close date with a relative date value (Ex. Today's Date), but for some reason when I use the Opp9, it prefills with an exact value (Ex. puts in as text {!Today()}. I am not great with code, and I've thankfully been able to trial and error a lot from the community. Help please!
My Controller is as follows:
public class RedirectNewOpptyController {
public RedirectNewOpptyController(ApexPages.StandardController controller) {
}
public pagereference navigateToURL(){
return new pageReference('/setup/ui/recordtypeselect.jsp?ent=Opportunity&opp9={!Today()}&nooverride=1&retURL=%2F006%2Fo&save_new_url=%2F006%2Fe%3FretURL%3D%252F');
}
}
My Controller is as follows:
public class RedirectNewOpptyController {
public RedirectNewOpptyController(ApexPages.StandardController controller) {
}
public pagereference navigateToURL(){
return new pageReference('/setup/ui/recordtypeselect.jsp?ent=Opportunity&opp9={!Today()}&nooverride=1&retURL=%2F006%2Fo&save_new_url=%2F006%2Fe%3FretURL%3D%252F');
}
}
try this: but I'm nut sure, if date will be in correct format for this url hack...... but hope you understand what I wanted to do and you can finish it :)
Marek
Unfortunately, I can't use a custom button because I am trying to place this on the Opportunity Home Page and redirect the standard "New" button.
I've updated by VF page and it works now! Thanks!
Please do not forget to mark best answer and so set topic to SOLVED ;)