public class LeadInsertController{
public Lead le {get;set;}
public LeadInsertController(){
le = new Lead();
}
public PageReference saveit () {
try {
insert le;
le = new Lead();
}
catch (Exception e) {
ApexPages.addMessages (e);
}
return page.SecondPage_Vf; // NAme of your other Visualforce Page
}
}
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
public class LeadInsertController{
public Lead le {get;set;}
public LeadInsertController(){
le = new Lead();
}
public PageReference saveit () {
try {
insert le;
le = new Lead();
}
catch (Exception e) {
ApexPages.addMessages (e);
}
return page.SecondPage_Vf; // Name of your other Visualforce Page
}
}
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Not navigating to other page. My another requirement is i have a button, "Submit for Approval" and my discount limit is 10. This button should get hide if discount is less than 10 and visible only if greater than 10
Greetings to you!
Please try the below code, I have tested in my org and it is working fine. Kindly modify the code as per your requirement.
Visualforce:
Controller:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Code is working but when click on save it should insert the record and at the same time should navigate to other vf page from previous vf page.
Thanks.
Try this:
Visualforce:
Controller:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Not navigating to other page. My another requirement is i have a button, "Submit for Approval" and my discount limit is 10. This button should get hide if discount is less than 10 and visible only if greater than 10