SetVBScriptRules2

Loads or scans a rules file, optionally validating whether the rules violate the referential integrity of any intercompany transactions.

SetVBScriptRules2 returns arrays that contain the line numbers, severity levels, descriptions, contents, and details of the lines in a rules file that do not pass validation. These arrays have a one-to-one correspondence, with one item for each line that does not pass validation.

Tip:

Variables cannot be tested for validity, so whenever SetVBScriptRules2 encounters a line containing a variable, items with a severity level of Information are included in the arrays. The descriptions for these lines say that “validation was not performed.”

Syntax

<HsvCalculate>.SetVBScriptRules2 varabRules, vbScanOnly, vbCheckRefIntegrity, pvbErrorsWereFound, pvbWarningsWereFound, pvbInfoWasProvided, pvaralErrorLineNumbers, pvaralErrorSeverity, pvarabstrErrorDescriptions, pvarabstrErrorVBScript, pvarabstrErrorDetails, pbstrRefIntegDiagXML

Argument

Description

varabRules

Variant (ByVal). The rules file, passed as an array of bytes.

vbScanOnly

Boolean (ByVal). A flag that specifies whether to load or scan the rules file. Pass TRUE to scan, FALSE to load.

If you pass FALSE, the rules file is scanned before loading.

vbCheckRefIntegrity

Boolean (ByVal). A flag that specifies whether to validate the referential integrity of intercompany transactions. Pass TRUE to validate intercompany transactions, FALSE otherwise.

If you pass TRUE, the pbstrRefIntegDiagXML argument will return information regarding any intercompany transactions that are rendered invalid.

pvbErrorsWereFound

Boolean. Indicates whether SetVBScriptRules2 found any validation errors. Returns TRUE if errors were found, FALSE otherwise.

pvbWarningsWereFound

Boolean. Indicates whether SetVBScriptRules2 found any validation warnings. Returns TRUE if warnings were found, FALSE otherwise.

pvbInfoWasProvided

Boolean. Indicates whether SetVBScriptRules2 returns any information not classified as errors or warnings. Returns TRUE if non-error and non-warning information is returned, FALSE otherwise.

pvaralErrorLineNumbers

Variant array. Returns the line numbers to which the errors, warnings, and information apply. The array is returned as a Long subtype.

pvaralErrorSeverity

Variant array. Returns numbers that indicate the severity levels of the errors, warnings, and information. Valid return values are described in the following list:

  • 1 = Error severity level.

  • 2 = Warning severity level.

  • 3 = Information severity level.

The array is returned as a Long subtype.

pvarabstrErrorDescriptions

Variant array. Returns descriptions of the errors, warnings, and information. The array is returned as a String subtype.

pvarabstrErrorVBScript

Variant array. Returns the rules file statements to which the errors, warnings, and information apply. The array is returned as a String subtype.

pvarabstrErrorDetails

Variant array. Returns details that describe why the lines caused validation to fail. The array is returned as a String subtype.

pbstrRefIntegDiagXML

String. Returns an XML document that indicates any referential integrity errors; this argument is used if TRUE is passed to the vbCheckRefIntegrity argument. The XML document is structured as follows, with one <cell> tag for each intercompany transaction for which the rules file violates the referential integrity:

<refint>
  <module name="ICM"> 
    <table name="ICT_TRANSACTIONS"> 
      <section name="supportstran"> 
        <cell scenario="label" year="label" period="label" entity="label" account=="label" icp=="label" custom1="label" custom2="label" custom3="label" custom4="label" />
      </section> 
    </table> 
  </module> 
</refint>

The attributes of <cell> specify the member labels of a transaction’s dimension members