GetRule method
The GetRule method gets the SetupNode object that is referenced by a specified rule. You can use this method to identify objects (for example, pages) that require special processing when a node contains many child objects and rules.
Description
For example, the following rule references a page of type Main_Page. So, GetRule returns the Main_Page SetupNode object.<D type="Invoice">
.
.
<P type="Main_Page" pos="0" min="1" max="1"/> <!--Rule referencing page "Main_Page" -->
Syntax
- VBScript
oSNO.GetRule(nIndex as Long) child node as node object
- C#
TDCOLib.DCOSetupNode GetRule(int nIndex)
Arguments
- nIndex
- The index of the rule, where 0 is the first rule under this SetupNode object.
Applies to
All node typesReturns
Child node object if successful; otherwise nothing (null).C# Example
This example gets the SetupNode object for the Invoice document in the Setup DCO and then gets the first rule under this node. It then gets the SetupNode object for the child object that is referenced by this rule.m_oDCO.ReadSetup("C:\\Datacap\\APT\\dco_APT\\APT.XML");
TDCOLib.DCOSetup m_oDCOSetup = m_oDCO.SetupObject();
TDCOLib.DCOSetupNode m_oDCOSetupNode = m_oDCOSetup.GetNodeByName(1, "Invoice");
TDCOLib.DCOSetupNode m_oDCOSetupNode2 = m_oDCOSetupNode.GetRule(0);