*-- Override the parent class method so that it returns *-- .F. when the lAllowDelete property doesn't exist. LOCAL llRetVal, lnThisDataSession, lcAlias llRetVal = .F. IF TYPE("_screen.ActiveForm.lAllowDelete") <> "U" ** llRetVal is set to .T. here llRetVal = _screen.ActiveForm.lAllowDelete AND ; NOT _SCREEN.ActiveForm.lReadOnly ENDIF IF llRetVal lnThisDataSession = SET('DATASESSION') =messagebox("In allowdelete, lnThisDatasession is " + str(lnThisDataSession)) SET DATASESSION TO _screen.ActiveForm.DataSessionID =messagebox("In allowdelete, Datasession set to " + str(SET('DATASESSION'))) IF TYPE("_screen.ActiveForm.oBizObj") == "O" AND ; !ISNULL(_screen.ActiveForm.oBizObj) *-- Get the alias for the primary business object on *-- the active form lcAlias = _screen.ActiveForm.oBizObj.GetAlias() ELSE *-- Use the current alias lcAlias = ALIAS() ENDIF *-- The intention is to disable the delete option if the user *-- is currently adding a new record. IF !EMPTY(lcAlias) llRetVal = !IsAdding(lcAlias) ENDIF =messagebox("Exiting allowdelete, Datasession set back to " + str(lnThisDataSession)) SET DATASESSION TO lnThisDataSession && Errors on this Line ENDIF RETURN llRetValThe form moves/copies patients between caregivers and when moving one client, everything works fine. It's when there are multiple 'uses' that this error comes up.
Entering: 1 6 1 1st move/copy 1 6 1 2nd 6 6 6 Exit form 6 5 6Is there some reason to be setting/resetting datasession?