Sample functions

These sample functions are in the FSLIBIDMHELPER script library.

UpdateDocument

You can use this function to update IDM documents. To use this function, you must copy this function to the script library.

UpdateDocument (DocCode As String, objSymbol As String, objKey As String, filename As String)
Input Parameter Description
DocCode IDM Document Code for the document to be updated.
objSymbol Optiva Symbol. For example, the symbol for the source object can be a Formula or an Item.
objKey

Optiva Object to update the Document for the given Doc Code.

For example, ITEM001 or FORMULA1\0001.

filename The file name of the IDM Document.

CopyDocument

You can use this function to copy a IDM document from a source object to another target object for the specified document code. To use this function, you must copy this function to the script library.
CopyDocument (DocCode As String, sourceSymbol As String, sourceKey As String, targetSymbol As String, targetKey As String, filename As String)
Input Parameter Description
DocCode The IDM Doc Code attached to the source object and to be attached to the target object.
sourceSymbol

The Optiva Object Symbol with the attachment to be copied to the target object.

For example, the symbol for the source object can be a Formula or an Item.

sourceKey

The Optiva Object to be copied and attached to the target object.

For example, ITEM001 or FORMULA1\0001.

targetSymbol

Optiva Object Symbol to attach to the copied attachment.

For example, the symbol for the source object can be a Formula or an Item.

targetKey

The Optiva Object to attach the copied attachment to.

For example, ITEM001 or FORMULA1\0001.

filename The name of the file to copy from source object to target object.

AttachDocument

You can use this function to create and attach an IDM document to the target object.

AttachDocument (DocCode As String, objSymbol As String, objKey As String, filename As String)
Input Parameter Description
DocCode The IDM Doc Code for the file to be attached to.
objSymbol The Optiva Object Symbol to attach the document to.

For example, the symbol for the source object can be a Formula or an Item.

objKey The Optiva Object to attach the document to.

For example, ITEM001 or FORMULA1\0001.

FileName The file path of the file to attach to the object to.

SaveDocumentToFolder

You can use this function to save IDM documents to a specified folder.

The document object is retrieved from IDM with the GetDocument function. Then the function saves the IDM document object to the folder.
SaveDocumentToFolder (DocItem As String DocICP.CMItem, fileFolder As String)
Input Parameter Description
DocItem The IDM document to save to the folder.
fileFolder The file folder that document is saved to.

RetriveDocument

Use this function to retrieve the file stream of the specified IDM Document.

RetriveDocument (DocItem As DocICP.CMItem) As Stream
Input Parameter Description
DocItem The IDM document from the file stream to be retrieved.