IF NOT ThisForm.lKeyNewMode * Save changes (edit mode) If ThisForm.PreSaveHook() * Checks to see if there are 'mustkey fields', and then enforce them. If ThisForm.lCheckMustKey loObject = ThisForm.MustKeyEntered(ThisForm) If Type("loObject") == "O" loObject.SetFocus() Return EndIf EndIf lcSelect = CREATEOBJECT("cSelect", This.Parent.oBizObj.GetAlias()) If CURSORGETPROP("BUFFERING") != DB_BUFOPTTABLE If This.Parent.oBizObj.Save() = FILE_OK ThisForm.PostSaveHook() Else ThisForm.DisplayBrokenRules(This.Parent.oBizObj) EndIf Else This.Parent.oBizObj.lNoRecords = .F. EndIf EndIf ThisForm.KEYLISTOBJEDIT1.CListObj1.grdList.Refresh() ThisForm.KEYLISTOBJEDIT1.CListObj1.grdList.SetFocus() ThisForm.KEYLISTOBJEDIT1.PostEditHook() ELSE && Appended (new) record with changes If ThisForm.PreSaveHook() * Checks to see if there are 'mustkey fields', and then enforce them. If ThisForm.lCheckMustKey loObject = ThisForm.MustKeyEntered(ThisForm) If Type("loObject") == "O" loObject.SetFocus() Return EndIf EndIf lcSelect = CREATEOBJECT("cSelect", This.Parent.oBizObj.GetAlias()) If CURSORGETPROP("BUFFERING") != DB_BUFOPTTABLE If This.Parent.oBizObj.Save() = FILE_OK ThisForm.PostSaveHook() ThisForm.KEYLISTOBJEDIT1.SetButtonEnabledStatus() *Refreshall happens to clear out broken rules. Changed to refresh() *ThisForm.KEYLISTOBJEDIT1.CListObj1.grdList.RefreshAll() ThisForm.KeyListObjEdit1.cListObj1.grdList.Refresh() ThisForm.KEYLISTOBJEDIT1.CListObj1.grdList.nRecNo = RECNO() ThisForm.KEYLISTOBJEDIT1.CListObj1.grdList.SetFocus() Else ThisForm.DisplayBrokenRules(This.Parent.oBizObj) EndIf Else This.Parent.oBizObj.lNoRecords = .F. EndIf EndIf ENDIF