Creating Calculated Journal Entry Events
You can use Longview Designer to create Calculated Journal Entry events.
Specifying calculated journal entry settings
You can use Longview Designer to specify the main settings for a Calculated Journal Entry event.
Field | Notes |
---|---|
Application ID Prefix |
Type the name you want to use as the prefix for the calculated journal entry application ID. The application ID is the combination of the specified application ID prefix, the entity name (optional), two digits for the creation year indicator and two digits for the creation month indicator. For example, NCI_727_1610, where NCI would be the Application ID Prefix. The complete application ID name can have a maximum of 31 characters. |
JE Description |
Type a description for the Calculated Journal Entry. The description can have a maximum of 100 characters, including spaces. |
JE Notes |
Type any detailed notes for the Calculated Journal Entry. This is an optional parameter. The notes field can have a maximum of 1280 characters, including spaces. |
JE Subcategory |
Type a valid journal entry sub-category. If no sub-category is chosen, Adjustment is used by default. |
Create a calculated journal entry by entity |
Select this option if a journal entry by entity is needed. Note: If this option is selected, the application ID will include the entity name. |
Is this a financial JE? |
Specify if the journal entry is financial:
The default setting is Yes. |
Is this a Shared JE? |
Specify if the journal entry is shared:
The default setting is Yes. |
Specifying the manual trigger override
Use Manual Trigger Override to specify any commands to run if the event is triggered manually.
The manual trigger override is typically used to set any E_<DIMNAME> variables where the symbol to be calculated in the event is different than the symbol set up in the manual trigger event rule.
For example, normally a manual trigger event rule is set to use CURRENCIES_Default as the currencies symbol. However, the calculation itself is normally performed on all currencies. The default code block in the manual trigger override sets the E_CURRENCIES variable to all currencies.
Specifying the main procedure
The Main Procedure is the controlling procedure that is run when the event is triggered. A standard code template is provided and can be modified. The standard code provided performs the following:
- Creates a data area where the calculations will be performed
Note: The template code creates the data area using Main.lvdsp. This data area spec will need to be created. See Specifying the data area definition for more information
- Processes each time period and determines:
- If it is the current period, the calculated journal entry type would be CURRENTPERIOD
- If it is not the current period, the calculated journal entry type would be PPA (Prior Period Adjustment)
- Processes each entity individually and adds the entity name to the APP ID if ‘Create a calculated JE by entity’ is selected. For more information, see Specifying Calculated Journal Entry Settings.
Note: The application ID is the combination of the specified application ID prefix, the entity name (optional), two digits for the creation year indicator and two digits for the creation month indicator. The complete application ID name can have a maximum of 31 characters. If the entity name is too long and would cause the application ID to be over 31 characters, the entity name will be truncated in the application ID.
- Runs the “CJE\ProcessCJE.lvpro” procedure which handles processing, creating and posting the calculated journal entry. For more information on the flow of the ProcessCJE procedure, see Calculated Journal Entry Event Template - Process Flow.
Note: If you are creating a persistent event, you may want to make use of the LVS_EVENTINITIALIZE, LVS_EVENTSHUTDOWN and LVS_PERSISTENT system variables to improve the efficiency and speed of your events. You can use the template document “Template_Event_Persistent” to provide a framework for using these system variables in your code. For more information, see Working with system variables for persistent event rules.
Specifying the set values procedure
The Set Values Procedure is the procedure where the values for the calculated journal entry are determined. The values should be stored in variables which would be used in the calculated journal entry detail.
For more information, see Specifying Calculated Journal Entry Detail.
Within the Set Values procedure, variable CJE_IsPostRequired should be set to 1 when posting is required, and set to 0 when posting is not required.
If a journal entry is required to be unposted, deleted or created and posted within the Set Values procedure, the following procedures can be used:
- CJE\UnPost.lvpro
- CJE\Delete.lvpro
- CJE\CreateAndPost.lvpro
Prior to running these procedures, the variable CJE_Status should be checked to make sure the journal entry is eligible to be unposted, deleted, or created and posted. The following CJE_Status values are valid for each action:
Action | Valid CJE_Status value |
---|---|
Unpost |
5 = Review |
Delete |
1 = No Status 3 = Validated |
Create and Post |
0 = Does Not Exist 1 = No Status 3 = Validated |
Each procedure will reset the CJE_Status variable upon completion.
You can use the template document “Template_CJE_Process_Line” to provide a framework for your set values procedure.
For more information on Template Documents, see "Template documents".
Example:
Set VARIABLE credDebAmt1 = Round(Value("daMain", "7500", "$CJE_PostPeriod$", "737", "GL", "SCENARIOS_A001", "USDT"), 2)
Set VARIABLE credDebAmt2 = Round(Value("daMain", "7750", "$CJE_PostPeriod$", "878", "GL", "SCENARIOS_A001", "USDT"), 2)
Set VARIABLE credDebTotal = $credDebAmt1$ + $credDebAmt2$
Set VARIABLE CJE_IsPostRequired = Round($credDebTotal$, 2) != 0
Specifying calculated journal entry detail
Use Calculated JE Details to add detail lines that the calculated journal entry event will use to post. The header of the calculated journal entry is handled internally based on the settings set in Specifying calculated journal entry settings.
You can use the Detail template for syntax reference by typing in Template in the Calculated JE Detail.
For more information on Calculated journal entry documents, see “Creating CalculatedJESpec documents” in the Longview Developer’s Guide.
Example:
Detail DEBIT, $credDebAmt1$, 7500, 737A, CONS_IC, SCENARIOS_A001, USD
Detail CREDIT, $credDebAmt1$, FXIC, 737A, CONS_IC, SCENARIOS_A001, USD
Detail DEBIT, $credDebAmt2$, 7750, 878A, CONS_IC, SCENARIOS_A001, USD
Detail CREDIT, $credDebAmt2$, FXIC, 878A, CONS_IC, SCENARIOS_A001, USD
Specify the data area definition
Use Data Area Definition to specify the data area to be queried for the export. Open the data area definition to specify its properties.
Note: The name of the data area definition is Main.lvdsp and the name of the data area created using it is daMain.
- For the Name, enter the name of your Trigger Area
Note: The name must 29 or fewer characters and only contain alphanumeric characters and underscore “_”.
- In the Options table, complete the following fields:
Field Notes Data type
Specify the data to be queried using one of the following options:
- ADJUSTED — Indicates that data queries include adjustments made via journal entries
- UNADJUSTED — Indicates that data queries exclude adjustments made via journal entries
Default is ADJUSTED.
Download type
Specify the type of data to be downloaded using one of the following options (download option specific in brackets):
- Exclude parent values — Indicates that parent data is excluded in the download (STANDARDLEAFONLY)
- Exclude parent and calculated values — Indicates that only leaf data that was submitted to the database via import, input or event calculation is included in the download (LEAFDATA).
Default is All data.
- In the Trigger Area table, complete the following fields for each dimension:
Note: The Spec and Level fields are not applicable if a symbol contains a variable.
Field Notes Symbols
Type a symbol name. Alternatively, you can use the symbol selector.
To add more than one symbol for a dimension, select a row containing the dimension for which you want to add another symbol and click Symbol.
To move a symbol up or down within a dimension, click Move Up or Move Down.
Note: To use the symbol selected by the user or defined by an attribute, enter the name of the dimension as a variable. For example, $ENTITIES$.
Spec
Indicate the symbol specification using one of the following values:
- All: Includes all symbols within the selected symbol’s hierarchy.
- Leaf: Includes only leaf symbols within the selected symbol’s hierarchy.
- Parent: Includes only parent symbols within the selected symbol’s hierarchy.
- Root and Parent: Includes only root and parent symbols within the selected symbol’s hierarchy.
Note: To use the symbol selected by the user or defined by an attribute, enter the name of the dimension as a variable. For example, $ENTITIES$.
Level
Specify the number of levels down from the symbol to be included in the data area.
-
Use Additional Configuration to specify any other Data Area Definition features you wish to use. Additional Configuration is a code editor that allows you to enter data area definition functions to be included in the data area.
For more information on the code editor, see Using the Code Editor.
Typical use of Additional Configuration in a data area definition is to
- Add an attribute filter using the AttributeFilter function
- Add a schedule to the using the Schedule function
- Add a temporary symbol using the TempSym function
Specifying procedures
Use Procedures to create any additional procedures that are required as part of the app, event, or configuration library.
To create a procedure:
- Right-click on Procedures and select New Document.
- For the Name, enter the name of your Procedure.
- In the code editor, enter the commands to run when the procedure is executed. For more information on procedures, see Developing Longview Procedures.
Specifying models
Use Models to create models that are executed as part of the app, event, or configuration library.
To create a model:
- Right-click on Models and select New Document.
- For the Name, enter the name of your Model.
- In the code editor, enter the code required for the model calculation. For more information on models, see Developing Longview Models.
Specifying table definitions
To create a table definition:
- Right-click on Table Definition and select New Document.
- For the Name, enter the name of your Table Definition.
- In the columns section the table and columns are defined.
- For the table name, select the table to use. The list includes all app tables defined in the system.
- If you pick a table based on a view it will display an information icon indicating that the table will be read-only.
- After selecting a table the columns in the table will be displayed. All columns will be selected by default. Also the columns that define the primary key will be indicated with a key icon. If some or all of the primary key columns are not included, the table will be read only.
- You may add or remove temporary columns using the Add Column and Remove Column buttons.
Note: Temporary columns are added to the table for use with an app, but are not submitted to the database.
- For each column complete the following fields:
Field Notes Include
Check each column to be included in the query. Use the check box in the header to select all columns.
Column
For persistent table columns, displays the name of the column. For temporary columns, enter the name of the column.
Nullable
Indicates whether the column can be saved with no value specified. If any non-nullable columns are excluded the table will be read-only.
Type
For persistent table columns, displays the data type of the column.
For temporary columns, select the data type for the column.
If you select Symbol[Dimension], you will be prompted to select the dimension that applies.
If you select Symbol[DimensionColumnName], you will be prompted to select a column (of type Dimension).
Values (String)
For String columns allows you to optionally define a list of values the user can select from.
Enter a | delimited list of values.
Optionally enter a | delimited list of display values by placing a semi-colon after the list of values.
Note: You can also use variables to define the list of values and display values.
Values
(Symbol)For Symbol columns allows you to limit the symbols available.
Enter a | delimited list of symbol specifications. You can also use a form to select the symbol specifications by clicking the search icon.
Note: You can also use a variable to define the list of symbol specifications.
Values (User)
For User columns, allows you to limit the users available for selection. Enter (or select) a | delimited list of user and group names.
Note: You can also use a variable to define the list of users and groups.
Values (User List)
For UserList columns, allows you to limit the users available for selection. Enter (or select) a | delimited list of user and group names.
Note: You can also use a variable to define the list of users and groups.
Allow Override
For String columns with Values defined, indicates whether the user can enter a value that is not in the list of values.
Min / Max (Date)
For date columns, allows you to set a valid range of selectable dates.
Note: The interface only supports explicit dates. To specify the valid date range using variables use the Additional Configuration section to define the date range using the SetColumn function.
Default (Boolean)
For Boolean columns, allows you to indicate if the default value for the column is checked.
Default (Dimension)
For Dimension columns, allows you to set he default dimension to be selected when a new row is added.
Default is no default selection.