GetJournal

Returns a variety of information for a journal.

Caution!

To successfully call GetJournal, the user must be assigned to the Journals Administrator or Read Journals role, and must have Read or All access to the journal’s security class. For posted journals, the user must also have Read or All access for the entities in the journal’s line items.

The amounts for the journal’s line items are returned in an array with a Double subtype. To return line item amounts in an array with a String subtype, use GetTextJournal. GetTextJournal is almost identical to GetJournal; the only difference is the subtype of the line item amount array. For more information, see GetTextJournal.

The first three arguments specify the scenario, year, and journal IDs. The next several arguments return journal header information, and the remaining arguments return line item data in arrays. The arrays have a one-to-one correspondence; for example, the second elements in the pvaradAmount and pvararlAccount arguments’ arrays return the amount and account for the journal’s second line item.

Syntax

<IHsvJournalsEx>.GetJournal lScenario, lYear, lJournalID, plPeriod, plValue, pnType, pnStatus, pnAttribute, pbstrLabel, pbstrDescription, pbstrGroup, plSingleEntity, plSingleParent, plSecurityClass, pvararlEntryID, pvararnDebitCreditUnit, pvaradAmount, pvararbstrDescription, pvararlEntity, pvararlParent, pvararlAccount, pvararlICP, pvararlCustom1, pvararlCustom2, pvararlCustom3, pvararlCustom4

Argument

Description

lScenario

Long (ByVal). The member ID of the Scenario dimension member.

lYear

Long (ByVal). The member ID of the Year dimension member.

lJournalID

Long (ByVal). The ID of the journal. Get this ID with HsvJournals.GetItemID; for details, see GetItemID.

plPeriod

Long. Returns the ID of the journal’s period.

plValue

Long. Returns the member ID of the Value dimension member for the journal’s currency.

pnType

Integer. Returns the journal’s type. The valid return values are represented by the HFMConstants type library constants listed in Journal Type Constants.

pnStatus

Integer. Returns the journal’s status. The valid return values are represented by the HFMConstants type library constants listed in Journal Status Constants.

pnAttribute

Integer. Returns a value that indicates whether the journal must be balanced. The valid return values are represented by the HFMConstants type library constants listed in Balance Type Constants.

pbstrLabel

String. Returns the label of the journal.

pbstrDescription

String. Returns the description of the journal.

pbstrGroup

String. Returns the description of the journal group to which the journal has been assigned.

plSingleEntity

Long. For single entity journals, this argument returns the ID of the journal’s base entity. If the journal is a multi-entity journal, this argument returns -1.

plSingleParent

Long. For single entity journals, this argument returns the ID of the journal’s parent entity. If the journal is a multi-entity journal, this argument returns -1.

plSecurityClass

Long. Returns the ID of the journal’s security class.

Tip:

To get the label of the security class, pass this ID to HsvSecurityAccess.GetSecurityClassLabel. For more information, see GetSecurityClassLabel.

pvararlEntryID

Variant array. For internal use.

pvararnDebitCreditUnit

Variant array. Indicates whether the line items are debits or credits. Valid return values are represented by the HFMConstants type library constants listed in Debit/Credit Constants.

The array is returned as an Integer subtype.

pvaradAmount

Variant array. Returns the amounts for the journal’s line items.

The array is returned as a Double subtype.

Tip:

Use GetVariance to return the total debit and credit amounts and the difference between these amounts. For details, see GetVariance.

pvararbstrDescription

Variant array. Returns the descriptions for the journal’s line items.

The array is returned as a String subtype.

pvararlEntity

Variant array. Returns the member IDs for the base entities of the line items. For single-entity items, these IDs will be the same as the member ID returned in the plSingleEntity argument.

The array is returned as a Long subtype.

pvararlParent

Variant array. Returns the member IDs for the parent entities of the line items. For single-entity items, these IDs will be the same as the member ID returned in the plSingleParent argument.

The array is returned as a Long subtype.

pvararlAccount

Variant array. Returns the member IDs of the line items’ accounts.

The array is returned as a Long subtype.

pvararlICP

Variant array. Returns the member IDs of the line items’ Intercompany Partner dimension members.

The array is returned as a Long subtype.

pvararlCustom1

Variant array. Returns the member IDs of the line items’ Custom 1 dimension members.

The array is returned as a Long subtype.

pvararlCustom2

Variant array. Returns the member IDs of the line items’ Custom 2 dimension members.

The array is returned as a Long subtype.

pvararlCustom3

Variant array. Returns the member IDs of the line items’ Custom 3 dimension members.

The array is returned as a Long subtype.

pvararlCustom4

Variant array. Returns the member IDs of the line items’ Custom 4 dimension members.

The array is returned as a Long subtype.

Example

The following example shows how to call GetJournal; after calling GetJournal, you can get information about the journal from any of the non-ByVal arguments. The example declares several variables, most of which are used as GetJournal’s arguments. The user-defined GetMemberID function gets the member IDs for the dimension members passed to GetJournal; for details on GetMemberID, see the Examples for IHsvTreeInfo.GetItemID. HsvJournals.GetItemID gets the ID of the journal passed to GetJournal.

Dim lScen As Long, lYear As Long, lPer As Long
Dim lJnlPer As Long, lVal As Long, iType As Integer
Dim iStatus As Integer, iAttr As Integer, sLabel As String
Dim sDescHead As String, sGroup As String, lSingleEnt As Long
Dim lSinglePar As Long, lSecClass As Long, vaEntryIDs
Dim vaDebCredUnit, vaAmt, vaItemDesc, vaEnt, vaPar, vaAcct
Dim vaICP, vaCust1, vaCust2, vaCust3, vaCust4
'Get IDs for the ByVal arguments
lScen = GetMemberID(DIMENSIONSCENARIO, "Actual")
lYear = GetMemberID(DIMENSIONYEAR, "2000")
lPer = GetMemberID(DIMENSIONPERIOD, "July")
lJnlID = m_cHsvJournals.GetItemID(lScen, lYear, lPer, "Jnl993")
m_cIHsvJournalEx.GetJournal lScen, lYear, lJnlID, lJnlPer, _ 
lVal, iType, iStatus, iAttr, sLabel, sDescHead, sGroup, _ 
lSingleEnt, lSinglePar, lSecClass, vaEntryIDs, _ 
vaDebCredUnit, vaAmt, vaItemDesc, vaEnt, vaPar, vaAcct, _ 
vaICP, vaCust1, vaCust2, vaCust3, vaCust4