Load

Loads metadata into a Classic application, using a load file on the application server.

Caution!

The method will fail if executed against an application created with Performance Management Architect.

You can load files from client PCs with the HsvMetadataLoadACV type library. This library also offers properties and methods that simplify handling of the metadata load options. See Loading Metadata.

Syntax

<HsvMetadata>.Load bstrServerFilename, bstrServerLogFilename, varavSettings

Argument

Description

bstrServerFilename

String (ByVal). The name and path of the metadata load file. This file must exist on the application server.

Tip:

The load file format has changed since the original release of Financial Management. If the load file is in an obsolete file format, error number 80040526 (hexadecimal) is thrown.

bstrServerLogFilename

String (ByVal). The name and path of the log file. The path must exist on the application server.

varavSettings

Variant array (ByVal). The load options for the metadata load operation. The array is 1-based and contains 29 items. For details on indexes and valid values, see Table 58, Metadata Load Options.

Tip:

Use EnumLoadOptions to return information about the valid load options.

The following table describes the metadata load options. Note that the listed indexes apply to the array passed to Load and to the first dimension of the array returned by EnumLoadOptions.

Caution!

If you set one or more of the “Clear” options to TRUE, the application’s data will be erased. These are the options indexed from 9 through 16.

Table 58. Metadata Load Options

Index

Load Option Information

1

Option: Currencies

Usage: Specifies whether currencies are loaded.

Pass to Load: Boolean — TRUE to load currencies, otherwise FALSE.

2

Option: Scenarios

Usage: Specifies whether scenarios are loaded.

Pass to Load: Boolean — TRUE to load scenarios, otherwise FALSE.

3

Option: Entities

Usage: Specifies whether entities are loaded.

Pass to Load: Boolean — TRUE to load entities, otherwise FALSE.

4

Option: Accounts

Usage: Specifies whether accounts are loaded.

Pass to Load: Boolean — TRUE to load accounts, otherwise FALSE.

5

Option: Custom1

Usage: Specifies whether Custom 1 dimension members are loaded.

Pass to Load: Boolean — TRUE to load Custom 1 members, otherwise FALSE.

6

Option: Custom2

Usage: Specifies whether Custom 2 dimension members are loaded.

Pass to Load: Boolean — TRUE to load Custom 2 members, otherwise FALSE.

7

Option: Custom3

Usage: Specifies whether Custom 3 dimension members are loaded.

Pass to Load: Boolean — TRUE to load Custom 3 members, otherwise FALSE.

8

Option: Custom4

Usage: Specifies whether Custom 4 dimension members are loaded.

Pass to Load: Boolean — TRUE to load Custom 4 members, otherwise FALSE.

9

Option: ClearCurrencies

Usage: Specifies whether previously loaded currencies are deleted before metadata is loaded.

Pass to Load: Boolean — TRUE to delete previously loaded currencies, otherwise FALSE. Setting this to TRUE will erase all of the application’s data.

10

Option: ClearScenarios

Usage: Specifies whether previously loaded scenarios are deleted before metadata is loaded.

Pass to Load: Boolean — TRUE to delete previously loaded scenarios, otherwise FALSE. Setting this to TRUE will erase all of the application’s data.

11

Option: ClearEntities

Usage: Specifies whether previously loaded entities are deleted before metadata is loaded.

Pass to Load: Boolean — TRUE to delete previously loaded entities, otherwise FALSE. Setting this to TRUE will erase all of the application’s data.

12

Option: ClearAccounts

Usage: Specifies whether previously loaded accounts are deleted before metadata is loaded.

Pass to Load: Boolean — TRUE to delete previously loaded accounts, otherwise FALSE. Setting this to TRUE will erase all of the application’s data.

13

Option: ClearCustom1

Usage: Specifies whether previously loaded Custom 1 dimension members are deleted before metadata is loaded.

Pass to Load: Boolean — TRUE to delete previously loaded Custom 1 members, otherwise FALSE. Setting this to TRUE will erase all of the application’s data.

14

Option: ClearCustom2

Usage: Specifies whether previously loaded Custom 2 dimension members are deleted before metadata is loaded.

Pass to Load: Boolean — TRUE to delete previously loaded Custom 2 members, otherwise FALSE. Setting this to TRUE will erase all of the application’s data.

15

Option: ClearCustom3

Usage: Specifies whether previously loaded Custom 3 dimension members are deleted before metadata is loaded.

Pass to Load: Boolean — TRUE to delete previously loaded Custom 3 members, otherwise FALSE. Setting this to TRUE will erase all of the application’s data.

16

Option: ClearCustom4

Usage: Specifies whether previously loaded Custom 4 dimension members are deleted before metadata is loaded.

Pass to Load: Boolean — TRUE to delete previously loaded Custom 4 members, otherwise FALSE. Setting this to TRUE will erase all of the application’s data.

17

Option: Delimiter

Usage: Specifies a load file’s delimiter.

Pass to Load: String — a valid delimiter character. Note that EnumLoadOptions returns the valid delimiters.

18

Option: Prescan

Usage: Specifies whether a load file is loaded or is merely scanned for syntax accuracy when Load is called.

Pass to Load: Boolean — TRUE to scan without loading, FALSE to load the metadata. By default, this option is set to FALSE.

19

Option: AppSettings

Usage: Specifies whether application settings are loaded.

Pass to Load: Boolean — TRUE to load application settings, otherwise FALSE.

20

Option: FileFormat

Usage: Specifies whether the metadata load file is in an ASCII text or an XML format.

Pass to Load: Long — 0 to load a text file, 1 to load an XML file.

21

Option: UseReplaceMode

Usage: Specifies whether the metadata replaces or is merged with existing metadata.

Pass to Load: Boolean — TRUE to replace existing metadata, FALSE to merge with existing metadata.

22

Option: ConsolMethods

Usage: Specifies whether consolidation methods are loaded.

Pass to Load: Boolean — TRUE to load consolidation methods, otherwise FALSE.

23

Option: ClearConsolMethods

Usage: Specifies whether existing consolidation methods are cleared before metadata is loaded.

Pass to Load: Boolean — TRUE to delete previously loaded consolidation methods, otherwise FALSE.

24

Option: LoadSystemMembers

Usage: Specifies whether system members can be loaded.

Pass to Load: Boolean — TRUE to load system members, otherwise FALSE.

Note:

If this option is set to TRUE, you must also set to TRUE the options for the system members to be loaded.

25

Option: SystemAccounts

Usage: Specifies whether to load system accounts.

Pass to Load: Boolean — TRUE to load system accounts, otherwise FALSE.

26

Option: Values

Usage: Specifies whether Value dimension members are loaded.

Pass to Load: Boolean — TRUE to load Value dimension members, otherwise FALSE. These are system members, so if this option is set to TRUE you must also set the LoadSystemMembers option to TRUE.

27

Option: ICPs

Usage: Specifies whether Intercompany Partner dimension members are loaded.

Pass to Load: Boolean — TRUE to load Intercompany Partner dimension members, otherwise FALSE. These are system members, so if this option is set to TRUE you must also set the LoadSystemMembers option to TRUE.

28

For internal use.

29

Option: CheckIntegrity

Usage: Specifies whether to validate the integrity of the metadata file against the metadata in the current application.

Note:

If integrity errors occur, they are noted in the log file and no portion of the file is loaded into the application.

Pass to Load: Boolean — TRUE to check integrity, otherwise FALSE.

Example

The following method loads metadata from an XML file. EnumLoadOptions gets the default load options, and then the method sets the file format option to XML.

Sub LoadHfmMetaXml(sLoadFile As String, sLogFile As String)
Dim vaOpts As Variant, vaSettings() As Variant
'g_cMetadata is an HsvMetadata object reference
g_cMetadata.EnumLoadOptions vaOpts
'Assign the default values, which are stored in
'item # 2 of the second dimension of vaOpts.
ReDim vaSettings(LBound(vaOpts) To UBound(vaOpts))
For i = LBound(vaOpts) To UBound(vaOpts)
    vaSettings(i) = vaOpts(i, 2)
Next i
vaSettings(20) = 1
g_cMetadata.Load sLoadFile, sLogFile, vaSettings
End Sub