You need to sign in to do that
Don't have an account?

Pass control to the save process
Greetings,
Wondering if the following is possible via Apex coding -
I have some functioning Apex code that fires on a button-click. At the conclusion of that code, I'd like to pass/relinquish control to the save process, (via "update obj" or other construct). I say relinquish, because I'd like any validation rules / workflow rules to execute normally - (outside of Apex, as if the user themselves clicked "Save"). Whether the record actually is 'Saved' or generated errors is unimportant to this procedure.
Is this possible? Thanks for any information / assistance.
Pete
When your apex calls insert, update, or upsert the DML will execute your triggers, valdiation rules, workflows. Take a look at the link below for the order of execution.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm
As my code isn't triggered on save, (it's triggered via a button-click), there's no danger of recursion.
So there's no way to "push the save button" via Apex, other than via an update/insert <obj> call ?
Thanks,
Pete
The standard controller that you're instantiated for your VF page has a Save() method that you can call which will do the Save action on the record in the controllers context. It returns a pageReference to your apex code. You then either use that pageReference, or build another, and navigate "out" of your VF page to wherever you want to go.