DocAddAttach
You can use this function for Optiva Workflows.
Purpose
Attaches a file to an object and links to the attachment location.
Syntax
Dim variable As Integer = DocAddAttach(Symbol, Object, FunctionCode, FileName, Link,
Description)
Arguments
Part | Description |
---|---|
Symbol
|
Type of object. Use empty quotation marks to indicate the current symbol for the workflow. |
Object
|
Object code to attach document to. Use empty quotation marks to indicate the current object for the workflow. |
FunctionCode
|
A valid function code for the indicated symbol. |
FileName
|
Name and path of source file to attach.
If you do not use the Link argument, you
must include the path to the file name. If you use the
|
Link
|
Optional. Path to a file in a folder that
is accessible from the application server. If left blank, the
FileName value is used.
|
Description
|
Optional. Description of the attached file. |
Description
DocAddAttach
associates a file with an object.
DocAddAttach
does not publish documents. It attaches
files that are in a shared location that the application server can access.
To learn more about viewing and publishing attachments, see the Infor Optiva Application Configuration Guide.
Example
This example attaches a ChangeHistory.txt to the current formula. Before this command was run, this file was already placed in the published location accessible by the application server: \\server01\optiva\attached_files\.
“Recent Changes” is added as a description to the user interface.
DocAddAttach ("", "", "CHANGES", "ChangeHistory.txt",
"\\server01\optiva\attached_files\ChangeHistory.txt", "Recent Changes")
Another possibility is to create a versioning style for your files in the published area. That way, you can attach a unique version of the file.
DocAddAttach ("", "", "CHANGES", "ChangeHistory.txt",
"\\server01\optiva\attached_files\ChangeHistory_Version07.txt", "Recent Changes")