Skip to content

KVSPSACalc. Trace Management#

Procedures#

AddDescriptionFieldNoForIntermediateSum(Integer, Integer, Boolean) :#

Summary: Check if the group number is valid (1 to 5) and raise an error if not. After checking, it inserts a new entry into the description field numbers buffer.

procedure AddDescriptionFieldNoForIntermediateSum(GroupNo: Integer; FieldNo: Integer; IncludeCaption: Boolean): 

Parameters:

  • GroupNo: The group number to check.
  • FieldNo: The field number to insert into the description field numbers buffer.
  • IncludeCaption: Indicates whether to include the caption in the description field numbers buffer.

AddDescriptionFieldNoForRecord(Integer, Boolean) :#

Summary: This method is used to insert a field number into the description field numbers buffer

procedure AddDescriptionFieldNoForRecord(FieldNo: Integer; IncludeCaption: Boolean): 

Parameters:

  • FieldNo: The field number to insert.
  • IncludeCaption: Indicates whether to include the caption in the description field numbers buffer.

AddGroupingFieldNo(Integer, Integer, Boolean) :#

Summary: Adds a grouping field number to the grouping fields buffer and inserts a corresponding entry in the description field numbers buffer. This method is used to add a grouping field number for a specific group number. It checks if the group number is valid, inserts the grouping field number into the grouping fields buffer, and inserts a description field number entry with the specified field number and group number.

procedure AddGroupingFieldNo(GroupNo: Integer; FieldNo: Integer; IncludeCaption: Boolean): 

Parameters:

  • GroupNo: The Group No.
  • FieldNo: The field number to be added to the grouping fields buffer.
  • IncludeCaption: Indicates whether to include the caption in the description field numbers buffer.

Initialize(RecordId) :#

Summary: Initializes the trace management system with a source record ID. This method clears the global variables used for tracing and sets the current source record ID. It is essential to call this method before any tracing operations to ensure that the trace is correctly associated with the specified record.

procedure Initialize(SourceRecordID: RecordId): 

Parameters:

  • SourceRecordID: The ID of the source record for which the trace is being initialized.

TraceAmountLineWithoutRecord(Integer, Boolean, Text[250], Decimal) :#

Summary: This method is used to trace an amount line without associating it with a specific record. It creates a trace record with the specified level, caption, description, and amount.

procedure TraceAmountLineWithoutRecord(Level: Integer; Caption: Boolean; Description: Text[250]; Amount: Decimal): 

Parameters:

  • Level: The level of the trace record.
  • Caption: Indicates whether the trace record is a caption.
  • Description: The description of the trace record.
  • Amount: The amount associated with the trace record.

TraceAmountLineWithRecord(Integer, Boolean, Text[250], Decimal, RecordId) :#

Summary: This method is used to trace an amount line with a specific record ID. It creates a trace record with the specified level, caption, description, amount, and record ID. It is typically used to log detailed information about a specific record in the trace.

procedure TraceAmountLineWithRecord(Level: Integer; Caption: Boolean; Description: Text[250]; Amount: Decimal; RecId: RecordId): 

Parameters:

  • Level: The level of the trace record.
  • Caption: Indicates whether the trace record is a caption.
  • Description: The description of the trace record.
  • Amount: The amount associated with the trace record.
  • RecId: The record ID associated with the trace record.

TraceDescriptionLine(Integer, Boolean, Text[250]) :#

Summary: This method is used to trace a description line without associating it with a specific record. It creates a trace record with the specified level, caption, and description.

procedure TraceDescriptionLine(Level: Integer; Caption: Boolean; Description: Text[250]): 

Parameters:

  • Level: The level of the trace record.
  • Caption: Indicates whether the trace record is a caption.
  • Description: The description of the trace record.

TraceRecordSet(Variant, Integer, Integer, Boolean) :#

Summary: This method is used to trace a record set. It retrieves records from a specified record variant, processes them, and creates trace records for each. It can also apply grouping based on the grouping fields defined in the global buffer. The method supports skipping records with zero amounts if specified. It creates a grand total record at the end of the trace.

procedure TraceRecordSet(RecordVariant: Variant; Level: Integer; AmountFieldNo: Integer; SkipZeroAmountRecords: Boolean): 

Parameters:

  • RecordVariant: The variant containing the record set to be traced.
  • Level: The level of the trace records.
  • AmountFieldNo: The field number that contains the amount to be traced.
  • SkipZeroAmountRecords: Indicates whether to skip records with zero amounts.