*-------------------------------------------------- *-- Table buffering is on for this table / cursor *-- use GETNEXTMODIFIED. Set the llIschanged *-- flag accordingly. *-------------------------------------------------- LOCAL lnRecno, lcAlias, lcFldState lcAlias = THIS.GetAlias() lnRecno = RECNO(lcAlias) && Save the current record position lnNextModified = GETNEXTMODIFIED(0,lcAlias) *llIsChanged = IIF(lnNextModified = 0, .F., .T.) *-- CHANGE - WGB - January 21, 2005 - 10:36:24 * Code from Marcia Akins thread #941853 DO WHILE lnNextModified # 0 GO m.lnNextModified IN ( lcAlias ) lcFldState = NVL(THIS.GetFieldState(-1, lcAlias),"") && NVL( GETFLDSTATE( -1, lcALias ), '' ) IF NOT EMPTY( CHRTRAN( lcFldState, '13', '' ) ) *** Change is real - exit stage left llIsChanged = .T. EXIT ENDIF lnNextModified = GETNEXTMODIFIED(lnNextModified,lcAlias) ENDDO IF BETWEEN(lnRecno, 0, RECCOUNT(lcAlias)) GOTO lnRecno IN lcAlias ENDIFAlso, It doesn't make sense to issue a table update on a record that is new and empty, so the following code was implemented:
IF !This.IsNewAndEmpty() && JMW 01/21/05 lnRetVal = loExecutant.SAVE(tlAllRows, tlForce) ELSE lnRetVal = FILE_OK ENDIFIt also doesn't make sense to check the rules if there are no changes, so the following was also implemented:
IF TYPE('This.oBizRules') == 'O' AND This.Ischanged() && JMW This.oBizRules.ClearAllRules() This.oBizRules.CheckRules() llRetVal = This.oBizRules.GetCount() = 0 ENDIFShould you decide to release another version of the framework, please take these changes under consideration.