User Tools

Site Tools


addcontoltorule_add_managed_control_.htm
Navigation:  ABC Library Reference > RuleManager > RulesCollection Class Methods >====== AddControlToRule (add managed control ) ====== Previous pageReturn to chapter overviewNext page

AddControlToRule( rule,feq,action )

blk2blue.jpg

AddControlToRule Adds a control to the controls queue so that a specified action is taken when a particular rule in the managed collection is broken.
Rule A string constant, variable, EQUATE, or expression that contains the name of this rule. If rule names are not unique within the collection managed by this RuleManager object, results may be unpredictable.
Feq A numeric constant, variable, EQUATE, or expression that indicates the Field Equate number of a control whose hidden or disabled status will be determined by the status of this rule.
Action A numeric constant, variable, EQUATE, or expression that indicates the action to be taken with respect to this control when a rule is broken, defined as follows:
RuleAction:None EQUATE(0)
RuleAction:Hide EQUATE(1)
RuleAction:UnHide EQUATE(2)
RuleAction:Disable EQUATE(3)
RuleAction:Enable EQUATE(4)

Example:

Customer.SetErrorImage('~BRuleNo.ico')
Customer.SetDescription('Customer File Rules')
Customer.AddRule('StateRequired','State is required','cus:State <;<;> ',?cus:State,3)  
Customer.AddRule('ZipOK','Postal code must have valid format.','CheckCustomerZip()',?cus:ZipCode,3)  
Customer.AddControlToRule('StateRequired, ?cus:ZipCode,RuleAction:Hide) !Hide Zip Code field until state is filled in.
addcontoltorule_add_managed_control_.htm.txt · Last modified: 2021/04/15 15:56 by 127.0.0.1