You need to sign in to do that
Don't have an account?
Ujwala
Avoid resubmission on refresh of VF
Hi,
in my VF i am insert record in account on click of button.. but after clicking save button it creates record in database but at this stage only when i refresh page(F5 .. using chrome) again record is inserted in database.. I think it is happening because of browser warning "The page that you're looking for used information that you entered. Returning to that page might cause any action you took to be repeated. Do you want to continue?" when click refresh..
can anybody please suggest way forward to this condition..
in my VF i am insert record in account on click of button.. but after clicking save button it creates record in database but at this stage only when i refresh page(F5 .. using chrome) again record is inserted in database.. I think it is happening because of browser warning "The page that you're looking for used information that you entered. Returning to that page might cause any action you took to be repeated. Do you want to continue?" when click refresh..
can anybody please suggest way forward to this condition..
I think you are using Void as return type in your method. So you should change it by PageReference and set return URL is same.
Hope this will help you. Let me know if it helped or you need any more assistance.
Please mark this is as the solution if it solved your purpose.
Thanks,
Sohan Raj Gupta
All Answers
I think you are using Void as return type in your method. So you should change it by PageReference and set return URL is same.
Hope this will help you. Let me know if it helped or you need any more assistance.
Please mark this is as the solution if it solved your purpose.
Thanks,
Sohan Raj Gupta
yes it is working but every time i click save button whole page is reloading.. before this I was rerendering particular block on click of save. and one more thing..my page has validations from apex using addError method.. when there is error my page is not showing error .. when there is error immediatly page gets reloaded after adding pagereference..
If you are preforming any validation using APEX then you can retrun null in this case. So your error message will show on page.
You can also save your information using ActionFunction OR ActionSupport. By using that you can render particluar block also.
Regards,
Sohan Raj Gupta
return null raises same resubmission problem..
So i am redirecting using id of record.
Thanks for your help