Codeunit "Posting Preview Event Handler"
Event handler for capturing and managing posting preview entries across all ledger types. Intercepts posting operations to create temporary entries for preview display without database commits.
Remarks
Core Functionality: Subscribes to posting events from various posting codeunits to capture entries in temporary tables. Manages entry aggregation, display formatting, and transaction consistency validation.
Supported Entry Types: Handles all major ledger entry types including G/L, customer, vendor, item, VAT, bank, and resource entries. Provides specialized handling for document entries and navigation support.
Extensibility: Offers integration events for custom entry types and specialized preview display requirements. Supports custom entry modification and filtering through event subscribers.
Properties
| Name | Value |
|---|---|
| EventSubscriberInstance | Manual |
Methods
GetEntries
Retrieves captured preview entries for the specified table type. Returns temporary records containing all entries captured during preview processing.
procedure GetEntries(TableNo: Integer; var RecRef: RecordRef)
Parameters
| Name | Type | Description |
|---|---|---|
| TableNo | Integer |
Table number identifying the entry type to retrieve |
| RecRef | RecordRef |
Output record reference containing the captured preview entries |
IsTransactionConsistent
Determines whether the posting preview transaction maintained consistency. Validates that all preview operations completed without transaction errors or rollbacks.
procedure IsTransactionConsistent(): Boolean
Returns
| Type | Description |
|---|---|
| Boolean |
True if transaction remained consistent throughout preview processing |
ShowEntries
Displays detailed entries for the specified table type in appropriate preview pages. Opens specialized preview pages showing captured entries for comprehensive analysis.
procedure ShowEntries(TableNo: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| TableNo | Integer |
Table number identifying the entry type to display |
FillDocumentEntry
Fills the temporary Document Entry table with all posted entries from the preview transaction.
procedure FillDocumentEntry(var TempDocumentEntry: Record "Document Entry" temporary)
Parameters
| Name | Type | Description |
|---|---|---|
| TempDocumentEntry | Table Microsoft.Foundation.Navigate."Document Entry" |
Temporary table to populate with document entry records. |
InsertDocumentEntry
Inserts a single preview entry into the temporary Document Entry table.
procedure InsertDocumentEntry(RecVar: Variant; var TempDocumentEntry: Record "Document Entry" temporary)
Parameters
| Name | Type | Description |
|---|---|---|
| RecVar | Variant |
Source record variant to insert as document entry. |
| TempDocumentEntry | Table Microsoft.Foundation.Navigate."Document Entry" |
Temporary table to insert the document entry into. |
PreventCommit
Prevents database commits during preview operations to maintain preview-only transaction state.
procedure PreventCommit()
SetShowDocumentNo
Controls whether document numbers are displayed in preview results.
procedure SetShowDocumentNo(NewShowDocNo: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| NewShowDocNo | Boolean |
True to show document numbers, false to hide them. |
Events
OnAfterFillDocumentEntry
Raised after a document entry is populated during preview processing. Allows customization of document entry data for preview display.
[IntegrationEvent(False,False)]
local procedure OnAfterFillDocumentEntry(var DocumentEntry: Record "Document Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| DocumentEntry | Table Microsoft.Foundation.Navigate."Document Entry" |
The document entry record being filled. |
OnGetEntries
Raised when retrieving preview entries for a specific table during preview processing. Allows customization of which entries are included in preview display.
[IntegrationEvent(False,False)]
local procedure OnGetEntries(TableNo: Integer; var RecRef: RecordRef)
Parameters
| Name | Type | Description |
|---|---|---|
| TableNo | Integer |
The table number for which entries are being retrieved. |
| RecRef | RecordRef |
Record reference to the table being processed. |
OnAfterShowEntries
Raised after preview entries have been displayed for a specific table. Allows post-display processing and cleanup for custom preview entries.
[IntegrationEvent(False,False)]
local procedure OnAfterShowEntries(TableNo: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| TableNo | Integer |
The table number whose entries were displayed. |
OnBeforeModifyTempGLEntry
Raised before modifying a temporary G/L Entry record during preview processing. Allows customization of G/L entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempGLEntry(var Rec: Record "G/L Entry"; var TempCustLedgerEntry: Record "G/L Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Finance.GeneralLedger.Ledger."G/L Entry" |
The G/L Entry record being modified. |
| TempCustLedgerEntry | Table Microsoft.Finance.GeneralLedger.Ledger."G/L Entry" |
The temporary G/L Entry record to be modified. |
OnBeforeModifyTempCustLedgEntry
Raised before modifying a temporary Customer Ledger Entry record during preview processing. Allows customization of customer ledger entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempCustLedgEntry(var Rec: Record "Cust. Ledger Entry"; var TempCustLedgerEntry: Record "Cust. Ledger Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Sales.Receivables."Cust. Ledger Entry" |
The Customer Ledger Entry record being modified. |
| TempCustLedgerEntry | Table Microsoft.Sales.Receivables."Cust. Ledger Entry" |
The temporary Customer Ledger Entry record to be modified. |
OnBeforeModifyTempDtldCustLedgEntry
Raised before modifying a temporary Detailed Customer Ledger Entry record during preview processing. Allows customization of detailed customer ledger entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempDtldCustLedgEntry(var Rec: Record "Detailed Cust. Ledg. Entry"; var TempCustLedgerEntry: Record "Detailed Cust. Ledg. Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Sales.Receivables."Detailed Cust. Ledg. Entry" |
The Detailed Customer Ledger Entry record being modified. |
| TempCustLedgerEntry | Table Microsoft.Sales.Receivables."Detailed Cust. Ledg. Entry" |
The temporary Detailed Customer Ledger Entry record to be modified. |
OnBeforeModifyTempVendLedgEntry
Raised before modifying a temporary Vendor Ledger Entry record during preview processing. Allows customization of vendor ledger entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempVendLedgEntry(var Rec: Record "Vendor Ledger Entry"; var TempVendLedgerEntry: Record "Vendor Ledger Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Purchases.Payables."Vendor Ledger Entry" |
The Vendor Ledger Entry record being modified. |
| TempVendLedgerEntry | Table Microsoft.Purchases.Payables."Vendor Ledger Entry" |
The temporary Vendor Ledger Entry record to be modified. |
OnBeforeModifyTempDtldVendLedgEntry
Raised before modifying a temporary Detailed Vendor Ledger Entry record during preview processing. Allows customization of detailed vendor ledger entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempDtldVendLedgEntry(var Rec: Record "Detailed Vendor Ledg. Entry"; var TempVendLedgerEntry: Record "Detailed Vendor Ledg. Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Purchases.Payables."Detailed Vendor Ledg. Entry" |
The Detailed Vendor Ledger Entry record being modified. |
| TempVendLedgerEntry | Table Microsoft.Purchases.Payables."Detailed Vendor Ledg. Entry" |
The temporary Detailed Vendor Ledger Entry record to be modified. |
OnBeforeModifyTempVATEntry
Raised before modifying a temporary VAT Entry record during preview processing. Allows customization of VAT entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempVATEntry(var Rec: Record "VAT Entry"; var TempVATEntry: Record "VAT Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Finance.VAT.Ledger."VAT Entry" |
The VAT Entry record being modified. |
| TempVATEntry | Table Microsoft.Finance.VAT.Ledger."VAT Entry" |
The temporary VAT Entry record to be modified. |
OnBeforeModifyTempValueEntry
Raised before modifying a temporary Value Entry record during preview processing. Allows customization of value entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempValueEntry(var Rec: Record "Value Entry"; var TempValueEntry: Record "Value Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Inventory.Ledger."Value Entry" |
The Value Entry record being modified. |
| TempValueEntry | Table Microsoft.Inventory.Ledger."Value Entry" |
The temporary Value Entry record to be modified. |
OnBeforeModifyTempItemLedgerEntry
Raised before modifying a temporary Item Ledger Entry record during preview processing. Allows customization of item ledger entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempItemLedgerEntry(var Rec: Record "Item Ledger Entry"; var TempItemLedgerEntry: Record "Item Ledger Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Inventory.Ledger."Item Ledger Entry" |
The Item Ledger Entry record being modified. |
| TempItemLedgerEntry | Table Microsoft.Inventory.Ledger."Item Ledger Entry" |
The temporary Item Ledger Entry record to be modified. |
OnBeforeModifyTempFALedgEntry
Raised before modifying a temporary Fixed Asset Ledger Entry record during preview processing. Allows customization of FA ledger entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempFALedgEntry(var Rec: Record "FA Ledger Entry"; var TempFALedgEntry: Record "FA Ledger Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.FixedAssets.Ledger."FA Ledger Entry" |
The FA Ledger Entry record being modified. |
| TempFALedgEntry | Table Microsoft.FixedAssets.Ledger."FA Ledger Entry" |
The temporary FA Ledger Entry record to be modified. |
OnBeforeModifyTempEmplLedgEntry
Raised before modifying a temporary Employee Ledger Entry record during preview processing. Allows customization of employee ledger entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempEmplLedgEntry(var Rec: Record "Employee Ledger Entry"; var TempEmplLedgEntry: Record "Employee Ledger Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.HumanResources.Payables."Employee Ledger Entry" |
The Employee Ledger Entry record being modified. |
| TempEmplLedgEntry | Table Microsoft.HumanResources.Payables."Employee Ledger Entry" |
The temporary Employee Ledger Entry record to be modified. |
OnBeforeModifyTempBankAccLedgerEntry
Raised before modifying a temporary Bank Account Ledger Entry record during preview processing. Allows customization of bank account ledger entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempBankAccLedgerEntry(var Rec: Record "Bank Account Ledger Entry"; var TempBankAccLedgerEntry: Record "Bank Account Ledger Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Bank.Ledger."Bank Account Ledger Entry" |
The Bank Account Ledger Entry record being modified. |
| TempBankAccLedgerEntry | Table Microsoft.Bank.Ledger."Bank Account Ledger Entry" |
The temporary Bank Account Ledger Entry record to be modified. |
OnBeforeModifyTempResLedgerEntry
Raised before modifying a temporary Resource Ledger Entry record during preview processing. Allows customization of resource ledger entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempResLedgerEntry(var Rec: Record "Res. Ledger Entry"; var TempResLedgerEntry: Record "Res. Ledger Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Projects.Resources.Ledger."Res. Ledger Entry" |
The Resource Ledger Entry record being modified. |
| TempResLedgerEntry | Table Microsoft.Projects.Resources.Ledger."Res. Ledger Entry" |
The temporary Resource Ledger Entry record to be modified. |
OnBeforeModifyTempMaintenanceLedgerEntry
Raised before modifying a temporary Maintenance Ledger Entry record during preview processing. Allows customization of maintenance ledger entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempMaintenanceLedgerEntry(var Rec: Record "Maintenance Ledger Entry"; var TempMaintenanceLedgerEntry: Record "Maintenance Ledger Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.FixedAssets.Maintenance."Maintenance Ledger Entry" |
The Maintenance Ledger Entry record being modified. |
| TempMaintenanceLedgerEntry | Table Microsoft.FixedAssets.Maintenance."Maintenance Ledger Entry" |
The temporary Maintenance Ledger Entry record to be modified. |
OnBeforeModifyTempJobLedgerEntry
Raised before modifying a temporary Job Ledger Entry record during preview processing. Allows customization of job ledger entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempJobLedgerEntry(var Rec: Record "Job Ledger Entry"; var TempJobLedgerEntry: Record "Job Ledger Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Projects.Project.Ledger."Job Ledger Entry" |
The Job Ledger Entry record being modified. |
| TempJobLedgerEntry | Table Microsoft.Projects.Project.Ledger."Job Ledger Entry" |
The temporary Job Ledger Entry record to be modified. |
OnBeforeModifyTempExchRateAdjmtLedgEntry
Raised before modifying a temporary Exchange Rate Adjustment Ledger Entry record during preview processing. Allows customization of exchange rate adjustment entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempExchRateAdjmtLedgEntry(var Rec: Record "Exch. Rate Adjmt. Ledg. Entry"; var TempExchRateAdjmtLedgEntry: Record "Exch. Rate Adjmt. Ledg. Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Finance.Currency."Exch. Rate Adjmt. Ledg. Entry" |
The Exchange Rate Adjustment Ledger Entry record being modified. |
| TempExchRateAdjmtLedgEntry | Table Microsoft.Finance.Currency."Exch. Rate Adjmt. Ledg. Entry" |
The temporary Exchange Rate Adjustment Ledger Entry record to be modified. |
OnBeforeModifyTempWarehouseEntry
Raised before modifying a temporary Warehouse Entry record during preview processing. Allows customization of warehouse entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempWarehouseEntry(var Rec: Record "Warehouse Entry"; var TempWarehouseEntry: Record "Warehouse Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Warehouse.Ledger."Warehouse Entry" |
The Warehouse Entry record being modified. |
| TempWarehouseEntry | Table Microsoft.Warehouse.Ledger."Warehouse Entry" |
The temporary Warehouse Entry record to be modified. |
OnBeforeModifyTempPhysInventoryLedgerEntry
Raised before modifying a temporary Physical Inventory Ledger Entry record during preview processing. Allows customization of physical inventory entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempPhysInventoryLedgerEntry(var Rec: Record "Phys. Inventory Ledger Entry"; var TempPhysInventoryLedgerEntry: Record "Phys. Inventory Ledger Entry")
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.Inventory.Counting.Journal."Phys. Inventory Ledger Entry" |
The Physical Inventory Ledger Entry record being modified. |
| TempPhysInventoryLedgerEntry | Table Microsoft.Inventory.Counting.Journal."Phys. Inventory Ledger Entry" |
The temporary Physical Inventory Ledger Entry record to be modified. |
OnBeforeModifyTempDtldEmplLedgEntry
Raised before modifying a temporary Detailed Employee Ledger Entry record during preview processing. Allows customization of detailed employee ledger entry data before it's stored in the preview cache.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyTempDtldEmplLedgEntry(var Rec: Record "Detailed Employee Ledger Entry"; var TempDtldEmplLedgEntry: Record "Detailed Employee Ledger Entry" temporary)
Parameters
| Name | Type | Description |
|---|---|---|
| Rec | Table Microsoft.HumanResources.Payables."Detailed Employee Ledger Entry" |
The Detailed Employee Ledger Entry record being modified. |
| TempDtldEmplLedgEntry | Table Microsoft.HumanResources.Payables."Detailed Employee Ledger Entry" |
The temporary Detailed Employee Ledger Entry record to be modified. |