ATC: GET KEY dataPK | [doctype] project document supplemental; WITH option
This command loads a document. After this command, the loaded document is selected as the current document so that ATC: SET commands will affect it.
- KEY dataPK; is required if [DocType] project document supplemental is not used.
- dataPK specifies the doc master key or dataPK for a document.
- ; (semicolon) is required.
- [doctype] project document supplemental; is required as described if KEY dataPK is not used.
- [doctype] is optional; however, if used, it specifies the source Doc type by name (in square brackets, [ ]) or internal key. Doc type names are case-sensitive. If you don’t include a doctype, the Doc type of the current document is assumed.
- project is required. It specifies the Project ID. You can use an * to specify the same project as the current document.
- document is required. One of the following can be used:
- doc num specifies the source document number of an existing document to be used as a template and copied. You can specify a nested bookmark to get a document number from another field.
- = (equal sign) indicates the same document number as the current document.
- supplemental is optional and rarely used. It specifies either a batch number or the Contract ID.
- ; (semicolon) is required.
- WITH option is optional.
- DUE n specifies the number of days in which the gotten document is to be due. If not specified, the current value is not changed.
- BookmarkSource specifies that the document will become the source for bookmark expansion
- SELECT specifies that the document will become the target of SET statements and the source of alias.field evaluation and condition evaluation; effectively, this loaded document replaces the source document until the next ATC: SELECT SOURCE,
- SOURCE when combined with SELECT, specifies that the document acts only as the source; the target document is not changed.
Examples
ATC: GET [Bid]*=; WITH DUE 1 ATC: SET Title = Ta Dah ATC: SAVE
The above example means “get the Bid document with the same Doc number (as the current document) in the current project and set its due date to one day hence and its title to Ta Dah.”
ATC: IF Status IsChanging ATC: EXIT WHEN Status = I ATC: ALERT [Chris Demo] Title Quote # [DocHeader_DocNo] [DV_DocHeader_Status]; See document...[DocHeader_Title] for [DocRevision_CostImpact] ATC: SET $QuoteStatus = [DocHeader_Status] ATC: GET [Bid] * =; DUE 1 ATC: IF $QuoteStatus IN D,A,B ATC: SET Status = RB ATC: ENDIF ATC: SAVE ATC: ENDIF
The above example means “if the document status is changing and not to In Progress, create an alert for Chris Demo and then hold the new status in $QuoteStatus. Then get the corresponding Bid document, set its due date to tomorrow and change the status to Response Back.”
ATC: GET KEY $From; WITH BookmarkSource SELECT ATC: SET $DocStatus = [docheader_status] ATC: SET $HasItems = 0 ATC: IF HAS DocItem WITH true; ATC: * remember the item status for the new document ATC: SET $HasItems = 1 ATC: SET $SavedItemStatus = [DocItem_ItemStatus] ATC: ENDIF
The above example means “GET a document based on a key stored in $From. Set the loaded document as the source for both bookmark expansion and evaluations. Place the status of the document into $DocStatus and check if the document has item in order to set a variable
ATC: EXIT WHEN SourceContact IsEmpty 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 “if there is a source contact, and not yet an Excel Macro Workbook attached, GET the initial budget document (as the new source) and copy the XLSM to this document.
Last updated: July 30, 2021 at 14:46 pm ; green text = new