DeleteJournals

Deletes one or more journals. The vararlJournalIDs argument takes the IDs of the journals that are being deleted.

Caution!

The user must be assigned to the Journals Administrator or Create Journals role, otherwise error number 40D (hexadecimal) will occur.

Syntax

<IHsvJournalsEx>.DeleteJournals lScenario, lYear, vararlJournalIDs, pvararnRc

Argument

Description

lScenario

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

lYear

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

vararlJournalIDs

Long array (ByVal). The IDs of the journals to be deleted. Get these IDs with the HsvJournals object’s GetItemID method; for more information, see GetItemID.

Caution!

You cannot delete journals that have been posted or approved.

pvararnRc

Variant array. Returns codes that identify the success or failure of the journal deletions. The elements in this array have a one-to-one correspondence with the journal IDs passed in the vararlJournalIDs argument. Successfully deleted journals return 0.

The array is returned as an Integer subtype.

Tip:

If the user does not have ALL access to a journal’s security class, error code 40F (hexadecimal) is returned. If a journal has been posted or approved it cannot be deleted, and error code 418 (hexadecimal) is returned.

Example

This example deletes two journals. The calls to the user-defined GetMemberID function get the example’s dimension member IDs; for details on GetMemberID, see the Examples for IHsvTreeInfo.GetItemID. The laJnlIDs array variable is then populated with the journal IDs by HsvJournals.GetItemID. The member IDs for the Scenario and Year dimension are passed along with this array to DeleteJournals.

Dim lScen As Long, lYear As Long, lPer As Long
Dim laJnlIDs(1) As Long, vaRetVal
lScen = GetMemberID(DIMENSIONSCENARIO, "Actual")
lYear = GetMemberID(DIMENSIONYEAR, "2000")
lPer = GetMemberID(DIMENSIONPERIOD, "July")
laJnlIDs(0) = m_cHsvJournals.GetItemID(lScen, lYear, lPer, _ 
"Jnl392")
laJnlIDs(1) = m_cHsvJournals.GetItemID(lScen, lYear, lPer, _ 
"Jnl393")
m_cIHsvJournalEx.DeleteJournals lScen, lYear, laJnlIDs, vaRetVal