Codeunit 19 "Gen. Jnl.-Post Preview"
Base Application · Microsoft.Finance.GeneralLedger.Preview
Across versions
- BC23present
- BC241 procedures added
- BC25-30unchanged
Neighbourhood 77 connected objects and pages
Base Application · Microsoft.Finance.GeneralLedger.Preview · BC23-30 · source at ea08af5e · facts from BC29
Events published
OnBeforeRunPreview(Subscriber: Variant; RecVar: Variant)(integration): Integration event raised before executing posting preview operations. Enables custom preprocessing or validation before preview execution begins.OnRunPreview(var Result: Boolean; Subscriber: Variant; RecVar: Variant)(integration): Integration event raised to execute the actual posting preview operation. Allows custom posting codeunits to participate in the preview execution workflow.- subscribers: Codeunit 1021 “Job Jnl.-Post” OnRunPreview, Codeunit 224 “EmplEntry-Apply Posted Entries” OnRunPreview, Codeunit 226 “CustEntry-Apply Posted Entries” OnRunPreview, Codeunit 227 “VendEntry-Apply Posted Entries” OnRunPreview, Codeunit 231 “Gen. Jnl.-Post” OnRunPreview, Codeunit 241 “Item Jnl.-Post” OnRunPreview, Codeunit 443 “Sales-Post Prepayment (Yes/No)” OnRunPreview, Codeunit 445 “Purch.-Post Prepmt. (Yes/No)” OnRunPreview, Codeunit 5636 “FA. Jnl.-Post” OnRunPreview, Codeunit 5706 “TransferOrder-Post (Yes/No)” OnRunPreview, Codeunit 5761 “Whse.-Post Receipt (Yes/No)” OnRunPreview, Codeunit 5764 “Whse.-Post Shipment (Yes/No)” OnRunPreview, Codeunit 5853 “Invt. Doc.-Post (Yes/No)” OnRunPreview, Codeunit 5883 “Phys. Invt. Order-Post (Y/N)” OnRunPreview, Codeunit 5981 “Service-Post (Yes/No)” OnRunPreview, Codeunit 699 “Exch. Rate Adjmt. Process” OnRunPreview, Codeunit 6997 “Expense Preview Post Mgt.” OnRunPreview, Codeunit 7323 “Whse.-Act.-Post (Yes/No)” OnRunPreview, Codeunit 81 “Sales-Post (Yes/No)” OnRunPreview, Codeunit 901 “Assembly-Post (Yes/No)” OnRunPreview, and 2 more
OnAfterBindSubscription(var PostingPreviewEventHandler: Codeunit "Posting Preview Event Handler")(integration): Integration event raised after binding the posting preview event handler subscription. Enables custom initialization or configuration of the preview event handler.- subscribers: Codeunit 20565 “Subc. Posting Preview Binding” BindPostPrevEventHandlerOnAfterBindSubscription, Codeunit 6225 “Sust. Purchase Subscriber” OnAfterBindSubscription, Codeunit 6496 “Serv. Posting Preview Binding” BindPostPrevEventHandlerOnAfterBindSubscription, Codeunit 6792 “Wthldg Tax Preview Handler” OnAfterBindSubscription, Codeunit 6987 “Expense Report-Post” OnAfterBindSubscription, Codeunit 8076 “Deferral Post. Preview Binding” BindDeferralPreviewHandlerOnAfterBindSubscription, Codeunit 99000796 “Mfg. Posting Preview Binding” BindPostPrevEventHandlerOnAfterBindSubscription
OnAfterUnbindSubscription()(integration): Integration event raised after unbinding the posting preview event handler subscription. Enables custom cleanup or finalization after preview processing completes.- subscribers: Codeunit 20565 “Subc. Posting Preview Binding” UnbindPostPrecEventHandlerOnAfterUnbindSubscription, Codeunit 6225 “Sust. Purchase Subscriber” OnAfterUnbindSubscription, Codeunit 6496 “Serv. Posting Preview Binding” UnbindPostPrecEventHandlerOnAfterUnbindSubscription, Codeunit 6987 “Expense Report-Post” OnAfterUnbindSubscription, Codeunit 8076 “Deferral Post. Preview Binding” UnbindDeferralPreviewHandlerOnAfterUnbindSubscription, Codeunit 99000796 “Mfg. Posting Preview Binding” UnbindPostPrecEventHandlerOnAfterUnbindSubscription
OnSystemSetPostingPreviewActive(var Result: Boolean)(integration): Integration event raised to determine if posting preview mode is active at system level. Allows extensions to indicate whether preview operations should be enabled.- subscribers: Codeunit 20 “Posting Preview Event Handler” SetTrueOnSystemSetPostingPreviewActive
OnAfterIsActive(var Result: Boolean)(integration): Integration event raised after checking if posting preview is active. Enables extensions to modify the active state determination logic.OnBeforeShowAllEntries(var TempDocumentEntry: Record "Document Entry" temporary; var IsHandled: Boolean; var PostingPreviewEventHandler: Codeunit "Posting Preview Event Handler")(integration): Integration event raised before displaying all preview entries to the user. Enables custom entry filtering, modification, or alternative display handling.OnBeforeThrowError()(integration): Integration event raised before throwing the preview mode error to exit gracefully. Enables custom cleanup or finalization before preview termination.OnAfterShowAllEntries()(integration): Integration event raised after displaying all preview entries to the user. Enables custom post-display processing or additional user interactions.OnShowAllEntriesOnCaseElse(var TempDocumentEntry: Record "Document Entry" temporary; var PostingPreviewEventHandler: Codeunit "Posting Preview Event Handler")(integration): Integration event raised when no standard preview type matches the configuration. Enables custom preview display handling for extended preview scenarios.
Trigger event subscribers
- OnAfterUnBindSubscription: Codeunit 6792 “Wthldg Tax Preview Handler” OnAfterUnBindSubscription
Procedures
Preview(Subscriber: Variant; RecVar: Variant): Initiates posting preview for the specified document record using the provided posting codeunit. Executes posting logic in simulation mode without committing database transactions.GetPreviewHandler(var ResultPostingPreviewEventHandler: Codeunit "Posting Preview Event Handler"): Retrieves the current posting preview event handler instance for external processing. Enables access to captured preview entries and transaction details.IsActive(): Boolean: Determines whether posting preview mode is currently active. Checks both system-level and extension-specific preview activation status.IsSuccess(): Boolean: Determines whether the posting preview operation completed successfully. Validates that preview execution finished without posting errors.SetContext(Subscriber: Variant; RecVar: Variant): Sets the context for posting preview operations with the specified posting codeunit and record. Configures preview environment for later execution without immediate preview processing.ShowDimensions(TableID: Integer; EntryNo: Integer; DimensionSetID: Integer): Displays dimension information for a specific entry during posting preview operations. Shows dimension set details associated with preview entries for validation and analysis.ThrowError(): Triggers the preview mode error to exit posting preview operations gracefully. Used to terminate preview processing and return to normal application flow.MessageIfPostingPreviewMultipleDocuments(RecordRefToPreview: RecordRef; DocumentNo: Code[20])+ BC24: Displays a message when posting preview is requested for multiple documents. Informs users that preview will only show results for the first document in the selection.
Plus 3 local procedures.
Triggers
OnRun
Calls
From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an Object::"Name" argument. Interface dispatch and calls through events are not counted, so the list is not complete.
- Codeunit 28 “Error Message Management” (3 calls:
OnRun → LogError,PreviewStart → Activate,PreviewStart → PushContext) - Codeunit 20 “Posting Preview Event Handler” (1 call:
ShowAllEntries → FillDocumentEntry) - Codeunit 29 “Error Message Handler” (1 call:
PreviewStart → ShowErrors) - Codeunit 408 “DimensionManagement” (1 call:
ShowDimensions → ShowDimensionSet) - Codeunit 8703 “Feature Telemetry” (1 call:
Preview → LogUsage) - Codeunit 9080 “Journal Errors Mgt.” (1 call:
ShowAllEntries → GetNothingToPostErrorMsg) - Codeunit 9500 “Sequence No. Mgt.” (1 call:
PreviewStart → StopPreviewMode)
Called by
- Codeunit 224 “EmplEntry-Apply Posted Entries” (4 calls:
EmplPostApplyEmplLedgEntry → ThrowError,PostUnApplyEmployee → ThrowError,PreviewApply → Preview, …) - Codeunit 226 “CustEntry-Apply Posted Entries” (4 calls:
CustPostApplyCustLedgEntry → ThrowError,PostUnApplyCustomerCommit → ThrowError,PreviewApply → Preview, …) - Codeunit 227 “VendEntry-Apply Posted Entries” (4 calls:
PostUnApplyVendorCommit → ThrowError,PreviewApply → Preview,PreviewUnapply → Preview, …) - Codeunit 426 “Payment Tolerance Management” (4 calls:
CallPmtDiscTolWarning → IsActive,CallPmtTolWarning → IsActive,PurchPmtTolGenJnl → IsActive, …) - Codeunit 5706 “TransferOrder-Post (Yes/No)” (3 calls:
MessageIfPostingPreviewMultipleDocuments → MessageIfPostingPreviewMultipleDocuments,PostTransferOrder → ThrowError,Preview → Preview) - Codeunit 5981 “Service-Post (Yes/No)” (3 calls:
MessageIfPostingPreviewMultipleDocuments → MessageIfPostingPreviewMultipleDocuments,PreviewDocument → Preview,PreviewDocumentWithLines → Preview) - Codeunit 1021 “Job Jnl.-Post” (2 calls:
Code → ThrowError,Preview → Preview) - Codeunit 1520 “Workflow Event Handling” (2 calls:
RunWorkflowOnItemChanged → IsActive,RunWorkflowOnItemRenamed → IsActive) - Codeunit 241 “Item Jnl.-Post” (2 calls:
Code → ThrowError,Preview → Preview) - Codeunit 5761 “Whse.-Post Receipt (Yes/No)” (2 calls:
MessageIfPostingPreviewMultipleDocuments → MessageIfPostingPreviewMultipleDocuments,Preview → Preview) - Codeunit 5764 “Whse.-Post Shipment (Yes/No)” (2 calls:
MessageIfPostingPreviewMultipleDocuments → MessageIfPostingPreviewMultipleDocuments,Preview → Preview) - Codeunit 5853 “Invt. Doc.-Post (Yes/No)” (2 calls:
Code → ThrowError,Preview → Preview) - Codeunit 699 “Exch. Rate Adjmt. Process” (2 calls:
OnRun → ThrowError,Preview → Preview) - Codeunit 7323 “Whse.-Act.-Post (Yes/No)” (2 calls:
MessageIfPostingPreviewMultipleDocuments → MessageIfPostingPreviewMultipleDocuments,Preview → Preview) - Codeunit 81 “Sales-Post (Yes/No)” (2 calls:
MessageIfPostingPreviewMultipleDocuments → MessageIfPostingPreviewMultipleDocuments,Preview → Preview) - Codeunit 900 “Assembly-Post” (2 calls:
InitPost → IsActive,OnRun → ThrowError) - Codeunit 901 “Assembly-Post (Yes/No)” (2 calls:
MessageIfPostingPreviewMultipleDocuments → MessageIfPostingPreviewMultipleDocuments,Preview → Preview) - Codeunit 91 “Purch.-Post (Yes/No)” (2 calls:
MessageIfPostingPreviewMultipleDocuments → MessageIfPostingPreviewMultipleDocuments,Preview → Preview) - Codeunit 13 “Gen. Jnl.-Post Batch” (1 call:
ProcessLines → ThrowError) - Codeunit 20411 “Qlty. Receiving Integration” (1 call:
DetectIsPreviewPosting → IsActive) - Codeunit 21 “Item Jnl.-Check Line” (1 call:
RunCheck → IsActive) - Codeunit 231 “Gen. Jnl.-Post” (1 call:
Preview → Preview) - Codeunit 431 “IC Outbox Export” (1 call:
SendToExternalPartner → IsActive) - Codeunit 442 “Sales-Post Prepayments” (1 call:
Code → ThrowError) - Codeunit 443 “Sales-Post Prepayment (Yes/No)” (1 call:
Preview → Preview) - Codeunit 444 “Purchase-Post Prepayments” (1 call:
Code → ThrowError) - Codeunit 445 “Purch.-Post Prepmt. (Yes/No)” (1 call:
Preview → Preview) - Codeunit 5633 “FA Jnl.-Post Batch” (1 call:
Code → ThrowError) - Codeunit 5636 “FA. Jnl.-Post” (1 call:
Preview → Preview) - Codeunit 5760 “Whse.-Post Receipt” (1 call:
Code → ThrowError) - Codeunit 5763 “Whse.-Post Shipment” (1 call:
Code → ThrowError) - Codeunit 5883 “Phys. Invt. Order-Post (Y/N)” (1 call:
Preview → Preview) - Codeunit 5884 “Phys. Invt. Order-Post” (1 call:
Code → ThrowError) - Codeunit 5980 “Service-Post” (1 call:
PostDocumentLines → ThrowError) - Codeunit 6987 “Expense Report-Post” (1 call:
RunWithCheck → ThrowError) - Codeunit 7324 “Whse.-Activity-Post” (1 call:
Code → ThrowError) - Codeunit 80 “Sales-Post” (1 call:
FinalizePosting → ThrowError) - Codeunit 90 “Purch.-Post” (1 call:
FinalizePosting → ThrowError) - Codeunit 980 “Payment Registration Mgt.” (1 call:
Preview → Preview) - Table 6906 “Expense Report Header” (1 call:
Preview → Preview)
Ask your agent
Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: bcatlas_resolve_node(object_type: "codeunit", object_name: "Gen. Jnl.-Post Preview"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.