Record not saved when using sc_redir in onAfterUpdate event

Hi,

I have a form which adds records to another table in the onBeforeUpdate event and this works fine. The data from the form is saved in the database. When I add a sc_redir in the onAfterUpdate to another form (a control form to ask the user to create an invoice autmatically), the data in the form is not saved. To me it looks like a bug, because data should be saved already, right?

No this is not a bug, you are missing the sc_committrans because you do a sc_redir before that. So before doing the sc_redir apply a sc_committrans(); in your code and the update is saved.

Thanks, this worked (is was sc_commit_trans(); )