You need to sign in to do that
Don't have an account?
Thomas Reinman 18
'Save and New' commandButton for a Single Record
I have a requirement where I need to navigate to a new Visualforce page after saving the new record. Hence, I added a simple extension to try to resolve these two actions.
The page is redirecting to the other Visualforce page, but the record is not being saved.
I've noticed that the .save() method doesn't really factor in Validation rules the way the standard {!save} action DOES.
For this requirement, I've also tried using an INSERT DML statement instead of the .save() method, and I've even tried to use the standard {!save} method in conjunction with some Javascript redirection. Nothing seems to save the record.
Another important detail -- the data I'm trying to save as a new record is coming from three separate Visualforce pages. I know the data is stored in the viewstate because the standard 'Save' button creates a new record. However when attempting to use a custom 'save' via DML, an error pops up listing the Required fields that are missing (which were previously filled out on the 1st page).
Any suggestions....?
The page is redirecting to the other Visualforce page, but the record is not being saved.
I've noticed that the .save() method doesn't really factor in Validation rules the way the standard {!save} action DOES.
For this requirement, I've also tried using an INSERT DML statement instead of the .save() method, and I've even tried to use the standard {!save} method in conjunction with some Javascript redirection. Nothing seems to save the record.
Another important detail -- the data I'm trying to save as a new record is coming from three separate Visualforce pages. I know the data is stored in the viewstate because the standard 'Save' button creates a new record. However when attempting to use a custom 'save' via DML, an error pops up listing the Required fields that are missing (which were previously filled out on the 1st page).
Any suggestions....?
Thanks for the follow up, unfortunately I got the same results. The page does redirect but no record is saved. Do you have any other suggestions?