How do we use Form_AfterStay

  • Edit

When you are in a form and you click the button “save”, the form closes.
If you want your form to stay open after you save your data you must use the procedure that named Form_AfterStay.
See the example below. 

lib

proc Form_AfterStay()
     f   =
TopForm()

     pnl =
PByName(f;"CUSTOMER")
     tbl  =
TByName(pnl;"CUSTOMER")

     {
you must clear the form’s fields }
    
call TEdit(tbl)
   
 call TSetFld(tbl;"FIRST_NAME";"")
    
call TSetFld(tbl;"LAST_NAME";"")
     call TSetFld(tbl;"ADDRESS";””)
     call TSetFld(tbl;"PHONE";"")
    
call TSetFld(tbl;"CITY";"")
    
call TPost(tbl)

   
call ReLoadEditFields(f)
end