How to update a form and redirect with a button

Hi There,

Beside the update button i have a button where a user can see a preview of his filled in form.

but when the user presses this button before he updates the form, all work get lost.
So i would like this button to first save the form and then redirect.

i tried a couple of things but no working result.

// this saves the form in java
nm_atualiza(‘alterar’);
return false;

// this redirect the form to the preview
sc_commit_trans()
/*

  • door naar de preview
    */
    sc_redir(Z_ILP_les_detail_view, wk_id = [wk_id]; “_parent”);

but how can i combine this in one button?