KBA-01517: Overview of the NextDocFlow rules

Overview:

The NextDocFlow rules configure how the system responds to the Create Next command on the Document Options drop-down menu.

The NextDocFlow rule group is found in the Rules Maintenance tool on the System Admin Dashboard. Each rule in the group consists of a rule name, a filter value (which can be blank) and a result value.


Filter Value:

Any Doc type

The NextDocFlow rules take any Doc type (as defined in the Doc Types tool and appearing on the filter drop-down) as the filter value. This Doc type represents the source Doc type used to create the new document.


Result Value:

Varies

Result values for the NextDocFlow rules depend on the rule and are indicated within the description of each rule. Some rules are enabled and disabled through a checkbox in the result value, for example:
checkbox result value


Rules:

AttachmentFilter

Specifies (in the result value) which attachments should be copied from the source document to the new document. The result value  accepts a Boolean expression that references fields in the result set of f_DocAttachments, its parents and its children.  For example:

  • AttachedDocMaster is NULL = copy only attached files, not documents.
  • AttachedItemNumber is NOT NULL = copy only attachments associated with Items.
  • AttachedItemNumber is NULL = copy only attachments not associated with Items.
  • DocKey is NOT NULL = copy only attached files, not documents.
  • False = do not copy any attachments (default).
  • FileType = ‘PDF’ = copy only attached PDF files.
  • True = copy all attachments.

DocNoSuffixLen

Specifies (in the result value) the number of characters to be used to create a revision suffix on the base document number (DocNo). If the Doc type has a defined mask and the suffix length matches the last segment length, then the last segment is used. Otherwise, a dash and revision number are added. The default is 0 (meaning no revision number is calculated). The maximum is 9.

CloseWindow

[V2019+] Specifies (in the result value) if the source document window should automatically close.

  • False = source window stays open and moved left (default behavior prior to v2018)
  • True = source window will close (default)

FieldList

Specifies (in the result value) the semicolon-separated list of field names to be copied from the source document to the target document near the end of the creation workflow, but in a manner that differs from the default. By default, all fields are copied to the target document from the same fields in the source document. However, by default, RFQ Note fields are set to NULL by default. The syntax is targetable.field = sourcetable.field (so, for example, DocRevision.NoteA=DocRevision.NoteB would copy NoteB from the source document to NoteA in the target document. When sourcetable is omitted, the document header is assumed. When targetable is omitted, the source table is assumed.  Other possible tables are DocRevision and DocRoute (for first route only). You can specify targettable.field=NULL;. See Additional Comments below for when in the process this rule applies.

Note:  To override the default on RFQs, you can set FieldList = 0;

IncExclFilter

Specifies (in the result value) which inclusion and exclusion entries should be copied from the source document to the new document. The result value accepts a Boolean expression that references fields in the xsfInclusion table, its parents and its children. For example:

  • False = do not copy any inclusion/exclusion entries.
  • True = copy all inclusion/exclusion entries (default).

ItemFilter

Specifies (in the result value) which Items should be copied from the source document to the new document.  The result value accepts a Boolean expression that references fields in the xsfDocItem table, its parents and its children.  Note: for Projects created from a bid, use SovConfig | SOVFromBid. For example:

  • Billable = copy all Items marked as Billable.
  • False = do not copy any Items.
  • ItemStatus in ($$ItemStatusList) = copy all Items with the indicated Item status.
  • ItemStatus not in ($$ItemStatusList) = copy all Items without the indicated Item status.
  • True = copy all Items (default).

ItemStatusIn

Specifies (in the result value) the rule group used to enumerate Item status codes. The enumerated codes are used to replace $$ItemStatusList in the Item Filter rule (above). If the ItemFilter rule does not contain $$ItemStatus, this rule has no effect. (See also KBA-01443.)

  • DocItemStatusIsApproved = use the Item statuses enumerated in this rule group (see ).
  • DocItemStatusIsClosed = use the Item statuses enumerated in this rule group (default)

LikeFromType

Specifies (in the result value) the Doc type that is a model for the filter Doc type. This rule is useful when you have a custom Doc type that you want to behave like a standard Doc type. For example:

  • Submittal = preserve Item numbers like on the Submittal Doc type.
  • RFQ = renumber Items and set Quote Amount of new Items based on the Expense Amount of the source document like on the RFQ Doc type.

LinkDocs

Specifies (in the result value checkbox) whether the original and new documents should be linked.

  • unchecked = No (default).
  • checked = Yes.

MenuText

Specifies (in the result value) the text that appears in the Document Options drop-down menu. The default is Create $$ where $$ is the site name of the target Doc type, as specified in the TargetType rule (below).

OpenNewDoc

Specifies (in the result value checkbox) whether the new documents should automatically open in a new browser window.

  • unchecked = No.
  • checked = Yes.  (default)

RenumberItems

Specifies (in the result value checkbox) whether the document items should be renumbered.  This rule is ignored if the LikeFromType rule is Bid Package, OCO, PCO, RFQ, Submittal, Submittal Package (because these document types have specific internal requirements).

  • unchecked = No (default).
  • checked = Yes.

RunScript

Specifies (in the result value) the name of the workflow script (from the Workflow library) to be run after the initial save of the target document, but in the context of the source document. The default is to not run any script. Note: include an ATC: SAVE command in the workflow script. (For more information about workflow scripts, see the ATC Scripts and Workflow technical white paper.)

RunScriptOnSource

Specifies (in the result value) the name of the workflow script (from the Workflow library) to be run after the initial save of the target document, but in the context of the source document. (The script will have no access to the new document other than through qAlias bookmarks.) The default is to not run any script. Note: include an ATC: SAVE command in the workflow script. (For more information about workflow scripts, see the ATC Scripts and Workflow technical white paper.)

SourceDocStateFlags

Specifies (in the result value) the document states during which the Create Next option is enabled. Possible result values can be combined.

  • 002 = In Process.
  • 004 = Pending.
  • 032 = Closed.
  • 064 = Approved (default for most Doc types).
  • 128 = No document of Target Type already attached [V2020+]
  • 102 = Combines 64 + 32 + 4 + 2 (default for Submittals, RFIs and Commitments)

TargetType

Specifies (in the result value) the Doc type that is created by a Create Next option on the source document. The default is none. Note: Submittal, Submittal Package, RFI, Potential CO, Change Order, Commitment, Bid Package and RFQ do not require this rule for their legacy target document types (described in the Focus on Doc Types and Project Workflow guide) but the target type can be overridden by this rule.


Additional Comments:

The NextDoc process:

  1. The new Doc type is determined per TargetType rule.
  2. The entire DocHeader and DocRevision of the source document are copied exactly.  DocCopyConfig | FieldList is processed.
  3. Items, Attachments and Route are copied per the rules.
  4. Status of the new document is set to its default.
  5. The closed date of the new document is set to null.
  6. The new Doc Number is resolved.
  7. The new Doc Date is set to NOW.
  8. The new Owner Approver is set to null.
  9. Files are auto-attached per auto attach rules.
  10. The FieldList rule is processed (which can re-copy something nulled by default)
  11. The new document is saved.
  12. The RunScript rule is run.
    1. This rule can be used to blank out fields.
    2. This script should end with an ATC:SAVE.
  13. The RunScriptOnSource rule is run.

In addition, there are specifics for certain Doc types.  See also the LikeFromType rule above.

  1. Potential Change Order to Owner Change Order
    1. Owner Approver is copied instead of being set to null.
    2. Title of PCO is used as the Revisions description on the Owner CO.
  2. Submittal to Submittal Package
    1. Source Contact is set to null.
  3. RFI to any Change Order
    1. The first Item is created from the RFI’s Response note field.
    2. Source Contact is to the Project Source Contact.
    3. Responsible is set to null.
  4. RFQ to Commitment
    1. Title is copied.

Note: See also DocCopyConfig for similar rules that cover slightly different use cases.  Of particular note, the Create Next Meeting option uses the Doc Copy infrastructure, not Next Doc Workflow.


KBA-01517; Last updated: November 17, 2020 at 12:13 pm; green text = new