ATC: ATTACH MATCHING | COPY matching-pattern options

This command attaches files from the source document to the target document.

  • MATCHING is required if the intention is to attach a link to specific files from the source document. MATCHING cannot be used with COPY.  In V2021+, LINK can be used as a synonym for MATCHING.
  • COPY is required if the intention is to create copies (clones) of specific files already attached to the target document and then also attach them to the target document. COPY cannot be used with MATCHING.  In V2021+, CLONE can be used as a synonym for COPY.
  • matching-pattern is required. It can include one or two wildcards (%) at the beginning and/or end, along with a case-sensitive filename.
  • options are optional. There are several options that can be used singularly or together, separated by spaces.
    • [V23+] SOURCE contact specifies the source contact to be associated with the file attachment. The contact can be indicated by an email, user key, or user login.
    • [V23+] TYPE doctype specifies the Spitfire Document type to be associated with the file attachment. This doctype can be indicated by DocTypeKey or by [name] in square brackets.
    • [V23+] NOTE text; specifies the note to be associated with the file attachment. This free-form text must be ended by a semicolon. If the text includes a semicolon, use the ATC: SET $NoteVar = command prior to the ATC: ATTACH command.

Examples

ATC: ATTACH MATCHING *.pdf

The above example means “attach all PDF Attachment files on the source document to the target document.”

ATC: ATTACH MATCHING *Notification*

The above example means “attach all Attachment files that contain the word Notification on the source document to the target document.”

ATC: ATTACH COPY BondoniContract.pdf
ATC: SET TargetRow.Filename = [Final BondoniContract.pdf]

The above example means “copy the BondoniContract.pdf file from the source document and attach it to the target document as Copy of BondoniContract.pdf then change the name of the file to Final BondoniContract.pdf.

ATC: EXIT HAS DocAttachedFile WITH FileName LIKE ‘*.xlsm’;
ATC: GET [Budget] * 0001; WITH SELECT SOURCE
ATC: ATTACH COPY %.xlsm
ATC: SET TargetRow.Filename = [DCO_DocHeader_SourceContact] Line Detail.xlsm

The above example means

  1. exit if we already have an attached workbook
  2. GET the initial budget document as the source
  3. COPY (clone) the workbook attached to the budget onto the current document
  4. Adjust the name of the newly cloned attachment

Last updated: July 25, 2024 at 13:54 pm; green text = new