CasewareDocs

RegisterTableForMppTaskFactory

The execution context of a data preparation task was extended to include a service that provides access to objects that can register a table with a multiple period data preparation task. This service is also available for Standard Import Routines running on IDEA server.

The following code retrieves a reference to the service that provides access to the objects that register a database with a multiple period data preparation task:

'Retrieves a reference to the RegisterTableForMppTaskFactory service

'Min. IDEA version: IDEA 10.0 (SmartAnalyzer 10.0)

Dim mppTaskFactory As Object

Set mppTaskFactory = SmartContext.GetServiceById("RegisterTableForMppTaskFactory")

If the service is not available, GetServiceById returns nothing. The service is currently available only in the execution context of a data preparation task.

The task factory service implements the RegisterTableForMppTaskFactory interface with the following members:

Function NewRegisterTableForMppTask() As Object

This method returns an object that can be used to register a database with a multiple period data preparation task. The object implements the RegisterTableForMppTask interface with the following members:

  • Property TableName AsString
    Gets/sets the name of the database that will be registered. Default value: empty.
    This is a mandatory property.
  • Property ResultId As String
    Gets/sets the id of the multiple period data preparation task. Default value: empty.
    This is a mandatory property.
  • Property ResultName As String
    Gets / sets the name of the multiple period data preparation task. Default value: empty.
    This is a mandatory property.
  • Property ResultDisplayName As String
    Gets/sets the display name of the multiple period data preparation task. Default value: empty.
    This is a mandatory property.
  • Property AuditTestsFilter As Object
    Gets/sets the expression that identifies the audit tests that shall be associated with the multiple period preparation result.
    Default value: nothing.
    This is an optional property.
    A filter expression can be created by a call to
    SmartContext.MacroCommands.ContentEquationBuilder.GetStandardTestFilter<filter>, where filter is the value of the property Content Area in a Standard Import Routines SRS.
  • Property SystemLength As Long
    Gets/sets the standard account length that was determined by the calling Standard Import Routine based on the chart of accounts used.
    Default value: 0.
  • Function AddColumnInfo(ByVal tagId As String) As Object
    The function creates and adds a new object to the task's internal collection of columns that may require adjustments during the multiple period preparation.
    The parameter tagId is a string containing the ID of the tag attached to the column. An exception is thrown if the tag ID is empty or if the collection already contains an element with this tag ID.
    The function returns a reference to an object that implements the EditableMultiPeriodResultColumnInfo interface with the following members:
  • Property TagId As String
    Gets the tag ID. This property is read-only.
  • Property CalculatedLength As Long
    Gets/sets the calculated length of the column before adjustment.
    Default value: 0.
  • Property ApplySystemLength As Boolean
    Gets/sets a Boolean that specifies whether the column should be adjusted if SystemLength differs among the databases that belong to the target multiple period result.
    Default value: false.
  • Sub PerformTask()
    This method registers the table named TableName with the specified multiple period data preparation task.
    An exception is thrown if TableName, ResultId, ResultName or ResultDisplayName is null or empty.
  • Property ColumnsNamespaceId As Long
    Gets/sets the numeric ID of the columns name space of the table associated with the result.
    Default value: 0.
RegisterTableForMppTaskFactory | Caseware Docs