LOCAL liLoop, loRuleObj, lcBrokenRule loRuleObj = ThisForm.oBizObj.oBizRules IF DODEFAULT() # FILE_OK FOR liLoop = 1 TO loRuleObj.GetCount() lcBrokenRule = loRuleObj.GetBrokenRule(liLoop) *You'd have to create a priority list here (DO CASE statement maybe?) * for the potential broken rules and set focus based on lcBrokenRule value. NEXT liLoop ENDIFThis gets fairly messy, which is why I was suggesting to check the rules in the valid routine.
*CheckRules() code This.IsProjectNameValid() This.IsField2Valid() This.IsField3Valid() This.IsField4Valid()If you're using CheckRules() in this manner, you'll want to call the specific field validation routine(s) instead of the "master" method. Otherwise, you may create extraneous broken rules for validation routines you didn't intend to check.
>LOCAL loBizRules, llRetVal, lnRetVal > >loBizRules = ThisForm.oBizObj.oBizRules > >llRetVal = loBizRules.CheckRules() > >IF .NOT. llRetVal > > This.Parent.txlProjectName.TextBox.SetFocus() > >ENDIF > >lnRetVal = DODEFAULT() > >RETURN (lnRetVal) >