Using existing documents

You can send a reminder document to your customer with the original invoice attached as additional document. The original invoice was sent earlier, and is still available in the Document Store.

Use case:

  • Create a document type and report rule for the Reminder report, or use an existing document type.
  • Add an extra part to the Reminder document type, which includes the original invoice as an additional document.

Complete these steps:

  1. Start the Document Types (ttrpi2510m000) session. Select the Reminder document type and open its details.
  2. On the Parts tab, create a part with these properties:
    • Description : Original invoices
    • Destination Type : All
    • Part Type : Existing Document(s)
    • Simple Content : INV_#keyword4#.pdf
    • Relative Position : After
    • Order : 0
    • Separate File : Yes
  3. Specify the Condition Expression field with this code:
    table ttfacr200
    long node
    
    select tfacr200.ttyp, tfacr200.ninv
    from   tfacr200
    where  tfacr200.itbp = :#bp#
    and    tfacr200.balc > 0.0
    and    tfacr200._compnr = :dom.document.company
    selectdo
             node = dom.existing.document.add("INVOICE",
                             dom.document.company,
                             "keyword1", #bp#,
                             "keyword2", str$(dom.document.company),
                             "keyword3", tfacr200.ttyp,
                             "keyword4", str$(tfacr200.ninv))
             dom.add.part(node, 4)
    endselect
    return(true)
    
  4. Save this record.
  5. Click Validate to validate the document type.
  6. Run the Report Rules (ttrpi2520m000) session to map the new variables to report fields.
  7. Click Validate to validate the report rule.
  8. Print a reminder to the Document Output Management device and view the result.