LPARAMETERS tobizobj LOCAL lnRuleCount, lcRuleText, lcRuleString *If no business object is specified, default *to the primary business object IF VARTYPE(toBizObj) != 'O' IF VARTYPE(ThisForm.oBizObj) == 'O' toBizObj = ThisForm.oBizObj ELSE RETURN ENDIF ENDIF *If there are business rules attached to this business object check *the rules and report any problems IF TYPE('toBizObj.oBizRules') = 'O' *Check the business rules toBizObj.oBizRules.CheckRules() *If there are any violations, build a string and display it in a box IF toBizObj.oBizRules.GetCount() > 0 FOR lnRuleCount = 1 To toBizObj.oBizRules.GetCount() lcRuleText = toBizObj.oBizRules.GetBrokenRule[lnRuleCount] IF lnRuleCount = 1 lcRuleString = lcRuleText ELSE lcRuleString = lcRuleString + CHR(13) + lcRuleText ENDIF ENDFOR =MESSAGEBOX('The following problem(s) have been encountered:' + CHR (13) + CHR(13) + lcRuleString, 0+48 , 'Visual Payroll Business Rule Violation') RETURN ELSE *No violations, proceed as normal RETURN ENDIF ELSE *No business rules, proceed as normal RETURN ENDIFHTH,