doc=new("docflowdoc",flowid$,dfdoctype$,dfdocid$)
The docflowdoc object provides simplified access to a single document in a document flow. Most methods are mapped to those found in the docflow object, but don't require specification of the flow and document identification, since that is provided at the time the object is instantiated. This object is automatically provided in DocFlow scripting routines.
Properties
duedate$ is the due date for the document. This is a writable property and should be in yyyy-mm-dd format.
|
flowid$, dfdoctype$, dfdocid$ are document identifiers provided when the object is instantiated.
|
library$, doctype$, docid$, subid$ are values identifying the source document and image subid used when starting this document in the flow.
|
notes$ is a list of notes in inifile format. Each section is formatted as [yyyymmdd-hhmmss:userid], and the section content is the note text.
|
started$, updated$ are date values in yyyy-mm-dd hh:mm:ss format (24-hour clock) showing the start time and last-updated time.
|
step$ is the current step name.
|
stephist$ is a line-feed delimited list of step names, excluding the current step.
|
title$ is the title of the document. This is a writable property.
|
updatehist$ is a list of updates in tsv format, line-feed delimited updates, each in tab-delimited format with date (yyyy-mm-dd hh:mm:ss format), user, and description items.
|
url$ is a read-only property that returns the url for this document. It is the same as the geturl$() method, with no prefix argument.
|
Methods
addnote(note$) adds a note to the document.
|
addstamp(stampname$,left,top) adds the named stamp file to the flow document. The stamp name should be the base filename of a stamp image in the df/stamps directory. Left and top specify the position on the page in inches.
|
advance(errmsg$) moves the document a step forward in the flow, and runs the advance script code. The errmsg$ variable returns any errmsg$ set in the script code.
|
attachfile(file$[,newsubid$[,title$]]) adds the specified file, found on the unform server, as an attachment to the document. If newsubid$ is supplied, it is filled with the subid of the file just added. The subid is generated as 'upload*' in order to ensure that the file is copied to the original source document when the document is finalized. The title$ value, if supplied, creates a title for the attachment in the browser interface. If not supplied, the file name is used.
|
attachsubdoc(fromlib$,fromdoctype$,fromdocid$,fromsubid$[,newsubid$]) attaches an existing library archive image to the document in a flow. Flowid$, doctype$, and docid$ identify which flow document to modify, and fromlibrary$, fromdoctype$, fromdocid$, and fromsubid$ identify which existing image to attach. If newsubid$ is supplied, it is filled with the subid of the attachment just added.
|
delstamp(stampname$) removes stamps of the specified name from the flow document. The stamp name is the base filename of the stamp image from the df/stamps directory. Note the extension of the file is not needed, for example either "approved.jpg" or "approved" work.
|
|
finish(errmsg$) completes the document flow, creates the XML document and any attachment or annotation images, and runs the finalize script code. If the script code sets errmsg$, it is returned, though the finalize actions are not stopped. This operation is normally performed by the user interface, but script code could do so if there is reason to finalize a document without user action.
|
getfield$(name$) returns the value of the custom field identified by name$.
|
getfield(name$,value$) fills value$ with the value of the custom field identified by name$.
|
geturl$([scriptprefix$]) returns a url to display the document in a browser. The script prefix is the first portion of the url, including protocol, host, port, and script name, such as https://demo.example.com:28392/arc. If not supplied, the prefix comes from the external= setting in the [archive] section of uf101d.ini, or if executed in the context of a browser request, such as running a docflow job, it will match the browser's connection.
|
hasstamp(stampname$) returns true (1) if the named stamp exists on the flow document, or false (0) if not. Note the extension of the file is not needed, for example either "approved.jpg" or "approved" work.
|
initinvaliditems() initializes all validation error messages for the document.
|
iteminvalid(item$,errmsg$) sets a validation error message on a field name, using the item naming syntax of "field.name".
|
nextstep$(curstep$) returns the next sequential step name after the specified step name, in the flow specified. If the current step is the last step, "*" is returned. Use this function to retrieve the default next step in script code, in cases where the step order is not modified by scripting.
|
putfield(name$,value$) sets the value of the named field.
|
delfield(name$) removes the specified field in the document. This doesn't remove it from the flow definition, but just removes the record where it was stored for the document. It has the same effect as putfield with value$="".
|
reverse(errmsg$) moves the document a step backward in the flow. The errmsg$ variable is filled if an unexpected error occurs. This operation is normally performed through the user interface.
|
setstep(step|stepname$) sets the current step number of name of the document.
|
signaturefile$() extracts the signature file associated with the flow document and stores it as a JPEG file on disk, and returns the file name. If no signature file exists, null ("") is returned.
|
signatureid$() returns the subid of a signature image found in the flow document's attachments. It returns null ("") if no signature file exists. The signature file is identified as an attachment with an "upload" prefix and a title of "df-signature.jpg".
|
updatehist(what$) adds a message what$ to the update history of the document.
|
|
|