Approve2

Approves a process unit, and optionally attaches documents and approves all other process units that consist of the specified Scenario, Year, Entity, and Value dimension members and the other base Period dimension members.

Syntax

<HsvProcessFlow>.Approve2 lScenario, lYear, lPeriod, lEntity, lParent, lValue, vbUseAllValueMembers, vbApplyToAllPeriods, bstrAnnotation, varabstrPaths, varabstrFiles, psNewProcessState

Argument

Description

lScenario

Long (ByVal). The member ID of the process unit's Scenario dimension member.

lYear

Long (ByVal). The member ID of the process unit's Year dimension member.

lPeriod

Long (ByVal). The member ID of the process unit's Period dimension member.

lEntity

Long (ByVal). The member ID of the process unit's child Entity dimension member.

lParent

Long (ByVal). The member ID of the process unit's parent Entity dimension member.

lValue

Long (ByVal). The member ID of the process unit's Value dimension member.

vbUseAllValueMembers

Boolean (ByVal). Specifies whether process units for Value dimension members related to the lValue member are approved. Pass TRUE to approve related process units, FALSE to approve only the process unit for the lValue member.

vbApplyToAllPeriods

Boolean (ByVal). Specifies whether to approve the process units that consist of the specified Scenario, Year, Entity, and Value dimension members and the other base Period dimension members. Pass TRUE to approve these process units, FALSE otherwise.

If you specify TRUE and an error occurs for a period, Financial Management will attempt to approve the other periods’ process units.

bstrAnnotation

String (ByVal). The comment for the approval.

varabstrPaths

String array (ByVal). The paths in which the documents to be attached have been loaded. Folders in the path are delimited by backslashes ( \ ).

This array has a one-to-one correspondence with the varabstrFiles argument’s array of filenames.

varabstrFiles

String array (ByVal). The file names of the documents to attach.

Note:

Files must be loaded in the folder specified by the corresponding item in the varabstrPaths argument’s array, otherwise an error will be thrown.

psNewProcessState

Integer. Returns PROCESS_FLOW_STATE_APPROVED, which is the level constant for the Approved level.

Example

This example approves a process unit and attaches documents. The calls to the user-defined GetMemberID function get the process unit’s member IDs; for information on GetMemberID, see the Examples for GetItemID. These member IDs are then passed to Approve2.

Dim lScen As Long, lYear As Long, lPer As Long
Dim lEnt As Long, lPar As Long, lVal As Long
Dim cHsvProcessFlow As HsvProcessFlow, iState As Integer
Dim saPaths(1) As String, saNames(1) As String
lScen = GetMemberID(DIMENSIONSCENARIO, "Budget")
lYear = GetMemberID(DIMENSIONYEAR, "2005")
lPer = GetMemberID(DIMENSIONPERIOD, "July")
lEnt = GetMemberID(DIMENSIONENTITY, "NewYork")
lPar = GetMemberID(DIMENSIONENTITY, "UnitedStates")
lVal = GetMemberID(DIMENSIONVALUE, "USD")
saPaths(0) = "docs"
saPaths(1) = "docs"
saNames(0) = "Audit.txt"
saNames(1) = "Comments.txt"
'g_cSession is an HsvSession object reference
Set cHsvProcessFlow = g_cSession.ProcessFlow
cHsvProcessFlow.Approve2 lScen, lYear, lPer, lEnt, lPar, lVal, _
  False, False, "see attachments", saPaths, saNames, iState