>DO CASE > CASE oApp.oVar.DBTYPE = DBTYPE_NATIVE > BEGIN TRANSACTION > CASE oApp.oVar.DBTYPE = DBTYPE_SQL > SQLSETPROP(oApp.oVar.sqlHandler,"Transactions",DB_TRANSMANUAL) > IF SQLEXEC(oApp.oVar.sqlHandler,[BEGIN TRANSACTION]) < 0 > ASSERT .f. > ENDIF >ENDCASE > >IF this.Isnewrecord && If We need to Insert new record in parent table. > ** Update the Parent table, so we get ID back > IF this.Persons.Updatetable() && Just a method similar to TableUpdate() function with Error handling in it. > lnId = EVAL(this.Persons.Alias+[.Id]) > m.lnRetVal = This.UpdateCursors(lnId) && Update all child tables, here I call Updatetable() method for every CA I have in that Class > ENDIF >ELSE > m.lnRetVal = This.UpdateCursors() && Update all tables >ENDIF > >IF m.lnRetVal > DO CASE > CASE oApp.oVar.DBTYPE = DBTYPE_NATIVE > END TRANSACTION > CASE oApp.oVar.DBTYPE = DBTYPE_SQL > SQLEXEC(oApp.oVar.sqlhandler,[COMMIT TRANSACTION]) > SQLSETPROP(oApp.oVar.sqlHandler,"Transactions",DB_TRANSAUTO) > ENDCASE > IF this.lnrabid # crsPersons.Id > this.lnrabid = crsPersons.Id > ENDIF > this.Isnewrecord = .f. >ELSE > DO CASE > CASE oApp.oVar.DBTYPE = DBTYPE_NATIVE > ROLLBACK > CASE oApp.oVar.DBTYPE = DBTYPE_SQL > SQLEXEC(oApp.oVar.sqlhandler,[ROLLBACK TRANSACTION]) > SQLSETPROP(oApp.oVar.sqlHandler,"Transactions",DB_TRANSAUTO) > ENDCASE >ENDIF > >RETURN m.lnRetVal >Borislav,