This will be my save method of my base class
****************************************
LOCAL llUpdate, lnSelect, lcScanCond, lnRepocess
#define ccScanCond THIS.cBizID $ UPPER( gwtable.gwbizidlist) AND NOT EMPTY( gwtable.gwviewname)
llUpdate = .T.
lnSelect = SELECT()
lnReprocess = set("reprocess")
set reprocess to 4 seconds
SELECT gwtable
if this.lSafeSave
* Wrap the whole thing in a BEGIN/END TRANSACTION so we can rollback.
BEGIN TRANSACTION
* Spin through and try to update all views.
SCAN ALL FOR ccScanCond AND llUpdate
* Parm 1 is 1 for all rows, and parm 2 is .T. for force update even
* if someone else updated the record already.
llUpdate = llUpdate AND TABLEUPDATE( 1, .T., ALLTRIM(gwtable.gwviewname))
ENDSCAN
IF llUpdate
END TRANSACTION
ELSE
ROLLBACK
ENDIF
else
*/ lock all associated files before updating
SCAN ALL FOR ccScanCond
sele alltrim(gwtable.gwalias)
llUpdate = flock()
*/ leave when unsuccessful file lock
if not llUpdate
exit
endif
endscan
SELECT gwtable
SCAN ALL FOR ccScanCond
*/ update only if file locks were successful
if llUpdate
llupdate = TABLEUPDATE( 1, .T., ALLTRIM(gwtable.gwviewname))
endif
unlock in alltrim(gwtable.gwalias)
ENDSCAN
endif
SELECT (lnSelect)
set reprocess to lnReprocess
RETURN llUpdate
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only