Promote

Promotes a process unit to a specified review level.

To attach documents when promoting, use Promote2.

Syntax

<HsvProcessFlow>.Promote lScenario, lYear, lPeriod, lEntity, lParent, lValue, vbUseAllValueMembers, bstrAnnotation, sProcessStateToPromoteTo, 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). Determines whether process units for Value dimension members related to the lValue member are promoted. Pass TRUE to promote related process units, FALSE to promote only the process unit for the lValue member.

bstrAnnotation

String (ByVal). The comment for the promotion.

sProcessStateToPromoteTo

Integer (ByVal). The constant that identifies the level to which the process unit is being promoted. Use one of the level constants listed in Table 136, CEnumProcessFlowStates Enumeration.

psNewProcessState

Integer. Returns the constant that identifies the level to which the process unit has been promoted. If the call to Promote succeeds, this should be equal to the constant passed in the sProcessStateToPromoteTo argument.

Example

The following subroutine promotes process units. The subroutine takes the following arguments:

IHsvDataSecurity.GetProcessUnitAccessRights gets the connected user’s access rights to the process unit. If the user has All access, the HsvSecurityAccess method IsConnectedUserAllowedToPerformTask tests whether the connected user has been assigned to the role passed to ProcPromote; if this returns TRUE, Promote is called.

Sub ProcPromote(lScen As Long, lYear As Long, lPer As Long, _ 
  lEnt As Long, lPar As Long, lVal As Long, lRoleID As Long, _
  iState As Integer)
Dim cProcessFlow As HsvProcessFlow, iRetState As Integer
Dim bInRole As Boolean, lUnitRights As Long
Dim cSecurity As HsvSecurityAccess, cDataSec As IHsvDataSecurity
'g_cSession is an HsvSession object reference
Set cProcessFlow = g_cSession.ProcessFlow
Set cSecurity = g_cSession.Security
Set cDataSec = g_cSession.Security
cDataSec.GetProcessUnitAccessRights lScen, lYear, lPer, lEnt, lPar, _ 
  lVal, lUnitRights
If lUnitRights = HFM_ACCESS_RIGHTS_ALL Then
  cSecurity.IsConnectedUserAllowedToPerformTask lRoleID, bInRole
  If bInRole = True Then
    cProcessFlow.Promote lScen, lYear, lPer, lEnt, lPar, lVal, _ 
    False, "", iState, iRetState
  End If
End If
End Sub