Previous Topic

Next Topic

Inhoudsopgave

Book Index

Managing Document Links

Description

You can register a document once and then link the document to all records in Isah the document is related to, such as customers, suppliers and parts (over 60 different Isah items). For example, you could link the same assembly instructions to several parts. The links are defined in theT_DocumentDetail table.

Managing Document Links

Create Document Links based on the IISDMDocumentLinks interface. The document object contains a DocumentLinks object that includes methods for adding and deleting document links.

Use the Refresh method to read all links into the DocumentLinks object. The object contains a list of all Isah items the document is linked to.

The following example shows how to add a link to part 0. At last, it shows the number of document links.

Dim oDocument As IDMLink.Document

Set oDocument = New IDMLink.Document

oDocument.DocId = 224538

Try

oDocument.Refresh()

oDocument.AddDocumentLink 12, "0"

MsgBox "Number of links: " & oDocument.DocumentLinks.Count

Catch ex As Exception

MsgBox "Document 224538 is not present."

End Try

The following example shows how to delete the last document link and subsequently shows the list of remaining links.

Dim oDocument As IDMLink.Document

oDocument = New IDMLink.Document

oDocument.DocId = 224538

Try

oDocument.Refresh()

oDocument.DocumentLinks.Delete(oDocument.DocumentLinks.Count -1)

MsgBox "Number of links: " & oDocument.DocumentLinks.Count

End If

Catch ex As Exception

MsgBox("Document error: " & ex.Message)

End Try