[SOLVED] Table doesn't inserted after trigger sc_redirect

I have a table HCM_PERSON, with two apps HCM_PERSON_ADD, HCM_PERSON_MOD (both’ are FORM app, main record is pointing to table HCM_PERSON)

My idea is first enter app HCM_PERSON_ADD (which is defaulted to insert mode via code sc_apl_conf(“HCM_PERSON_ADD”, “start”, “new”):wink: - it’s working
After that, after user clicked “Add” button it redirect to form app, HCM_PERSON_MOD by calling sc_redir(“HCM_PERSON_MOD”, “”, “_parent”); in OnAfterInsert event. - it’s working.

When SC redirected me to form app HCM_PERSON_MOD, i realized table HCM_PERSON never inserted with any new record…
May i know the reason why? is it a bug or because i am not allow to call sc_redir if i am transferring from app to app which master record is the same? (HCM_PERSON)

Thanks for clarify and plz tell me how could i jump from app to app where they point to same master record.

The transaction is commit within your form at the very end. So if you do a sc_redir there will never be a commit. So I advise to do a sc_commit_trans() before doing the sc_redir. Look into the helpfile for details.

Thanks Albert! it’s working!