I am not sure if I understood your question, but you can retrieve the secondary object of a general link by performing a query.
-------------------------------------------------------------------------------
Example in VB6:
Public Sub GetSecondaryObj(ByVal oSession As SmApplic.SmSession, _
ByVal oLink As SmApplic.ISmObject, ByRef oSObj As SmApplic.ISmObject)
Dim oQuery As SmApplic.ISmSimpleQuery
Dim oResult As SmRecList.SmRecord
Set oQuery = oSession.ObjectStore.NewSimpleQuery
oQuery.SelectStatement = "select S.OBJECT_ID,S.CLASS_ID,S.TDM_ID " & _
"from TN_LINK_00007" & " L, TN_DOCUMENTATION S " & _
"where L.CLASS_ID=" & oLink.ClassId & " and " & _
"(L.OBJECT_ID=" & oLink.ObjectId & " and L.OBJECT_ID2=S.OBJECT_ID) "
oQuery.Run
If oQuery.QueryResult.RecordCount > 0 Then
Set oResult = oQuery.QueryResult.GetRecord(0)
Set oSObj = oSession.ObjectStore.ObjectFromData(oResult, True)
Else
Set oSObj = Nothing
End If
End Sub
-------------------------------------------------------------------------------
F --L--> S
if L is the link,
L.OBJECT_ID1 is the first (F) object
L.OBJECT_ID2 is the secondary (S) object.
If you want to retrieve more attributes than just OBJECT_ID, CLASS_ID, TDM_ID, add them in the "select" list.
The internal name of a general link is TN_LINK_00007 (Documents Documents Relation) You can find the names of the tables directly in the database. They are listed in the TDM_CLASS table.
Good luck
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP