Search Results for

    Show / Hide Table of Contents

    Email Vendor Remittance Job

    This page documents the vendor remittance advice email job implemented by codeunit 73053604 lts_opsaEmailVendRemittance.

    Purpose

    The job sends vendor remittance advice by email with a PDF attachment generated from Report Selections for P.V.Remit.

    Object And Entry Points

    • AL object: codeunit 73053604 lts_opsaEmailVendRemittance
    • Main runner: OnRun calls Process on lts_opsaEntry
    • Waiting entry creation: InsertWaitingEntry(VendorLedgerEntryNo)
    • Email sender: EmailVendorRemittance(VendorLedgerEntry, ToEmails)

    Prerequisites

    • App setting Enable Email Vendor Remittance Job is enabled.
    • At least one active Operations Automation Setup exists for:
      • Object Type to Run = Codeunit
      • Object ID to Run = lts_opsaEmailVendRemittance
      • Blocked = false
    • Vendor email address exists (resolved by lts_opsaEMail.GetVendorEmailAddress).
    • Report Selections for P.V.Remit. is configured.
    • If needed, a Custom Report Selection layout is configured for the vendor.

    How Waiting Entries Are Created

    InsertWaitingEntry(VendorLedgerEntryNo) performs the following:

    1. Reads the vendor ledger entry record.
    2. Verifies the feature flag Enable Email Invoice Job.
    3. Finds matching setup records for this codeunit.
    4. Applies setup record filters against Vendor Ledger Entry No.
    5. Prevents duplicate waiting entries for the same setup and source record unless AllowReEntry(true) is used.
    6. Creates a new entry with:
      • Description: To email remittance to: {Vendor No.} - {Document No.}
      • Status: Waiting

    Processing Flow

    When the entry runs:

    1. Process resolves Source Record ID to Vendor Ledger Entry.
    2. EmailVendorRemittance builds email details:
      • Subject: Vendor {Vendor No.}: Please find your remittance advice
      • Body: HTML generated from selected report and layout; falls back to subject text.
      • Attachment: PDF rendered from selected remittance report.
      • Filename: {VendorNo}_{DocumentNo}_remittance.pdf
    3. Email is sent through lts_opsaEMail.SendEmail.
    4. A success log is created: Vendor remittance emailed: {ToEmails}.

    Filtering Behavior

    Setup-level record filters are evaluated against Vendor Ledger Entry and entry number. Only entries included by setup filters generate waiting entries.

    Logging

    • Success log status: Success
    • Log message format: Vendor remittance emailed: {email list}

    Common Failure Points

    • To email address is blank for the vendor.
    • Report selection for P.V.Remit. is not configured.
    • Custom report layout configuration is invalid.
    • Email scenario or sending account is not configured in Business Central.

    Related Pages

    • How-to
    • Troubleshooting
    • Concepts
    • Edit this page
    In this article
    Back to top Lonicera