ATC: SAVE WITH options

This command saves the current document.  Starting with 2019.0.7473, errors during the save are catch-able (see ATC: CATCH).  You can specify WITH followed by these options (space separated):

  • Release – Releases exclusivity on the document
  • Ignore – Ignores any error during the save (rare!)
  • Fatal – makes any save error stop the script

Note: Usually, the document is automatically saved at the end of the workflow, so simple scripts do not need an ATC: SAVE.  Adding one in such scripts carries a performance penalty.

There are some use cases, however, where an ATC: SAVE may be needed:

  • before an ATC: QUERY
  • after an ATC: COPY if the new document is modified (see below)
  • in a series of changes that requires a progression
  • in scripts run by a Rule, such as NextDocFlow | RunScript

Examples

ATC: SET STATUS = I
ATC: COPY [Notification] * NEW; WITH LINK
ATC: BOOKMARKSOURCE SOURCE
ATC: SET DocNo = [DocHeader_DocNo]
ATC: SET SourceDocNo = [DocHeader_DocNo]
ATC: SET TITLE = [DocHeader_Title]
ATC: SET Subtype = AWS
ATC: SET DocRevision.Notes = Your Announcement goes here!
ATC: SAVE
ATC: SELECT SOURCE

The above example means “set the Status of the source document to In Process, then create a new document using ATC: COPY (which automatically saves the new document and makes it the target of the ATC: SET commands), then set the document number, source number, title, subtype and the note “Your Announcement goes here!”, then save the updated new document and reselect the source document.”  In this case, an explicit save is needed.

 

ATC: IF DocMasterDetail.Status = I
  ATC: STATUS P
  ATC: SAVE ATC:* first, we have to make the thing pending
ATC: ENDIF
ATC: STATUS A
ATC: Signoff = NOW

The above example means “if the document status is In Progress, set it to Pending and save it as Pending, then set the status to Approved and set the Signoff date.”  The automatic save is assumed at the end.

Important Note:  Avoid using workflow embedded in a route sequence “to Spitfire” to change the document status to special statuses that require validation (such as committed or approved).  These workflows are triggered AFTER the user has sent the document on and any failure will not return the document to the user.

 


Last updated: September 3, 2020 at 9:19 am;