Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

rule Element

Office 2007

Defines an action invoked after an event has occurred in the form.

Type

xsd:complexType

Child Elements

ElementDescription
assignmentActionDefines an action to set the value of a field.
closeDocumentActionDefines a form close action.
dialogBoxExpressionActionDefines an XPath expression to be displayed in a dialog box.
dialogBoxMessageActionDefines a literal message to be displayed in a dialog box.
exitRuleSetAn element which, if present at the end of the rule, stops further rule processing of the entire ruleSet when the rule is executed.
openNewDocumentActionDefines a form create action.
queryActionDefines a data connection query action.
submitActionDefines a form submit action.
switchViewActionDefines a view switch action.

Attributes

AttributeTypeRequiredDescriptionPossible Values
caption
xsd:string
YesContains the name of the rule as it appears in the user interface.string
xsd:string
condition
xsd:string
NoDefines the XPath expression, evaluated as a Boolean value, that determines whether the associated action will be invoked.string
xsd:string
isEnabled
xdYesNo
NoSpecifies whether the rule is enabled for the form. The default value is "yes".
  • yes
  • no
xdYesNo

Definition

<xsd:element name="rule">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:element ref="xsf:dialogBoxMessageAction"/>
        <xsd:element ref="xsf:dialogBoxExpressionAction"/>
        <xsd:element ref="xsf:switchViewAction"/>
        <xsd:element ref="xsf:assignmentAction"/>
        <xsd:element ref="xsf:queryAction"/>
        <xsd:element name="submitAction">
          <xsd:complexType>
            <xsd:attribute name="adapter" type="xsf:xdTitle" use="required"></xsd:attribute>
          </xsd:complexType>
        </xsd:element>
        <xsd:element ref="xsf:openNewDocumentAction"/>
        <xsd:element ref="xsf:closeDocumentAction"/>
      </xsd:choice>
      <xsd:element name="exitRuleSet" minOccurs="0">
        <xsd:complexType />
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="caption" type="xsd:string" use="required"></xsd:attribute>
    <xsd:attribute name="condition" type="xsd:string" use="optional"></xsd:attribute>
    <xsd:attribute name="isEnabled" type="xsf:xdYesNo" use="optional" default="yes"></xsd:attribute>
  </xsd:complexType>
</xsd:element>

Remarks

Example

The following is an example of the rule element:

<xsf:ruleSets>
 <xsf:ruleSet name="RuleSet1">
  <xsf:rule caption="Receipts" condition="my:expense> 75">
   <xsf:dialogBoxMessageAction>Don't forget receipts!</xsf:dialogBoxMessageAction>
    <xsf:openNewDocumentAction solution="urn:approvalForm"/>
    <xsf:exitRuleSet/>
  </xsf:rule>
  <xsf:rule caption="Always Submit" isEnabled="no">
   <xsf:submitAction adapter="Expense Database"/>
  </xsf:rule>
 </xsf:ruleSet>

 <xsf:ruleSet name="RuleSet2">
  <xsf:rule caption="Look up contact">
   <xsf:queryAction adapter="Contacts"/>
  </xsf:rule>
 </xsf:ruleSet>
</xsf:ruleSets> 


Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.