get_RuleMaxNumber Method

The get_RuleMaxNumber method gets the maximum number of child objects of the specified type that can be associated with the parent object without violating a document integrity rule.

Attention: .NET only. For VBScript, use the RuleMaxNum property instead.

Description

The maximum number is the max attribute in the Setup DCO XML file. In the following rule, the maximum number of pages of type Main_Page that a document of type Invoice can have is 1.
<D type="Invoice">
   .
   .
   <P type="Main_Page" pos="0" min="1" max="1"/>    <!--Rule-->

Syntax

C#
int get_RuleMaxNumber(int nIndex)

Arguments

nIndex
The index of the rule, where 0 is the first rule under the current SetupNode object.

C# Example

This example gets the max attribute of the first rule under the current SetupNode object:
int nMaxNum = m_oDCOSetupNode.get_RuleMaxNumber(0);