CreateJournalFromTemplate

Creates an HFMwJournal object from a given template, initializing the journal with the template’s data.

Tip:

To save the journal, pass the HFMwJournal object returned by CreateJournalFromTemplate to SaveJournal.

Syntax

<HFMwManageJournals>.CreateJournalFromTemplate (bstrScenario, bstrYear, bstrPeriod, bstrValue, varbCreateAsAutoReversing, bstrLabel)

Argument

Description

bstrScenario

The label of the journal’s Scenario dimension member.

Input argument. String subtype.

bstrYear

The label of the journal’s Year dimension member.

Input argument. String subtype.

bstrPeriod

The label of the journal’s Period dimension member.

Input argument. String subtype.

bstrValue

The label of the journal’s Value dimension member.

Input argument. String subtype.

varbCreateAsAutoReversing

A flag that determines whether the journal is auto-reversing. Pass TRUE to create an auto-reversing journal, FALSE otherwise.

Input argument. Boolean subtype.

bstrLabel

The label of the template. If the label is invalid, an error is returned.

Input argument. String subtype.

Return Value

Returns an HFMwJournal object reference.

Example

The following subroutine creates and saves a new journal. CreateJournalFromTemplate creates an HFMwJournal object, using the template, Point of View, and auto-reversing flag passed to the subroutine. HFMwJournal.label sets the journal label, using the label passed to the function. SaveJournal then saves the journal.

Sub AddNewJournal(sScen, sYear, sPer, sVal, bAutoRev, _
   sTemplate, sLabel)
Dim cHFMManageJournals, cHFMJournal
Set cHFMManageJournals = Server.CreateObject _
   ("Hyperion.HFMwManageJournals")
'g_cHFMSession is an HFMwSession object reference
cHFMManageJournals.SetWebSession(g_cHFMSession)
Set cHFMJournal = cHFMManageJournals.CreateJournalFromTemplate _
   (sScen, sYear, sPer, sVal, bAutoRev, sTemplate)
cHFMJournal.label = sLabel
cHFMManageJournals.SaveJournal cHFMJournal
End Sub