DocExist
You can use this function for Optiva Workflows and Copy Methods.
Purpose
Checks for the existence of text and attachments to a function code.
Syntax
Dim variable As Integer = DocExist(Symbol, Object, FunctionCode)
         Arguments
| Part | Description | 
|---|---|
Symbol | 
             Type of object. Use empty quotation marks to indicate the current symbol for the workflow. | 
Object  | 
             Object code to check for text and attachments. Use empty quotation marks to indicate the current object for the workflow. | 
FunctionCode | 
             A valid function code for the indicated symbol. | 
Description
DocExist checks for the presence of text and attachments to a particular function code for the indicated object. It returns a number:
| Return | Text | Attachments | 
|---|---|---|
| -1 | Invalid function code | Invalid function code | 
| 0 | No | No | 
| 1 | Yes | No | 
| 2 | No | Yes | 
| 3 | Yes | Yes | 
Examples
This example checks for the presence of text and attachments to a workflow formula. The formula code is PIZZA_SAUCE\003. If none are detected, a message is displayed to the user.
Dim iText As Integer = DocExist("FORMULA","PIZZASAUCE\003", "REPORT")
if (iText < 1) then
   MessageList("You must attach a report.")
end if
          This example checks for the presence of text in the SAFETY function code for the workflow object or new object. If there is none, a message is displayed to the user.
Dim iText As Integer = DocExist("","","SAFETY")
if (iText = 1 OR itext = 3) then
   Return 111
else
   MessageList("There are no Safety documents. Include some.")
   Return 1
end if
          This example checks for an attachment to the WEB function code for the workflow object or new object. If there is none, a message is displayed.
Dim iAttach As Integer = DocExist("","","WEB")
if (iAttach < 2) then
   MessageList("You must attach the intranet site.")
end if