GetTextTemplate

Returns a variety of information for a journal template.

Tip:

Use GetTextTemplate to create a journal from a template; GetTextTemplate’s return values can be passed to SaveTextJournal.

The first argument specifies the template’s ID. The next several arguments return template header information, and the remaining arguments return the template’s line item data in arrays. The arrays have a one-to-one correspondence; for example, the second elements in the pvarabstrAmount and pvararlAccount arguments’ arrays return the amount and account for the template’s second line item.

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

Syntax

<IHsvJournalsEx>.GetTextTemplate lTemplateID, pnType, pnAttribute, pbstrLabel, pbstrDescription, pbstrGroup, plSingleEntity, plSingleParent, pnTemplateType, plValueID, pvararlEntryID, pvararnDebitCreditUnit, pvarabstrAmount, pvararbstrDescription, pvararlEntity, pvararlParent, pvararlAccount, pvararlICP, pvararlCustom1, pvararlCustom2, pvararlCustom3, pvararlCustom4

Argument

Description

lTemplateID

Long (ByVal). The ID of the template. Pass the template label to GetJournalTemplateItemID to get this ID; for more information, see GetJournalTemplateItemID.

pnType

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

pnAttribute

Integer. Returns a value that indicates whether journals created from the template 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 template.

pbstrDescription

String. Returns the description of the template.

pbstrGroup

String. Returns the journal group of the template.

plSecurityClass

Long. Returns the ID of the security class for the template.

Tip:

To get the ID from a security class name, use HsvSecurityAccess.GetSecurityClassLabel.

plSingleEntity

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

plSingleParent

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

pnTemplateType

Integer. Returns the template type. The template types are represented by the HFMConstants type library constants listed in Template Type Constants.

plValueID

Long. For recurring templates, this argument returns the member ID of the template’s Value dimension member.

Since standard templates are not assigned a Value dimension member, this argument returns -1 when GetTextTemplate is called for a standard template.

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.

pvarabstrAmount

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

The array is returned as a Double subtype.

pvararbstrDescription

Variant array. Returns the descriptions for the template’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

GetTextTemplate is used in the Example for SaveTextJournal. This example shows how to pass GetTextTemplate’s return values to SaveTextJournal.