Domino 9 und frühere Versionen > Entwicklung

Tochterdoc ID als Link im Parentdoc

(1/2) > >>

MrMagoo:
Hallo,

ich schreib aus einem Tochterdokument heraus die Dokument ID in das Mutterdokument, funktioniert prima. Wie bekomme ich es aber hin, das die Dokument ID des Tochterdokuments, die jetzt ja in einem Feld im Mutterdokument stehlt, als Link auf das Tochterdokument behandelt?

Danke

Performance:
z.B
plink ist ein computed rtf Feld - hier schreibst du den link rein

im Queryopen des Doks - wird bei jedem öffnen berechnet:
If doc.HasItem( "plink" ) Then   
   Call doc.RemoveItem( "plink" )
End If
      
Set rtitem = doc.CreateRichTextItem( "plink" )
Set docChild = ..... deine initialisierung
         
Call rtitem.AppendDocLink( docChild , " <-- der Link zur Tochter")
Call rtitem.AddNewLine( 1 )


cu

wflamme:
Hier noch ein Oldtimer aus meiner KB:

FILE:    Linking a Parent to a Response
UPDATED: June 1996
AUTHOR:  Eric Koeler
         mailto:ekoeler@panix.com
         http://www.panix.com/~ekoeler
NOTE:    Copyright (C) 1997 by Eric Koeler, this file is protected by the
         GNU General Public License
----------------------------------------------------------------------------

Since every response document contains a field called $ref with its parent's Doc ID in it, you can set up a hidden view of response documents (No Response Hierarchy) with @Text($ref) as the first sorted column's formula - we'll call this view (ResponseLookupView) and this first sorted column Key.  
We can use this $ref field as a common unique lookup key.  Create a computed text field in the response document, call it myID, with @DocumentUniqueID as the formula.  Now create a computed text or a computed for display field in the parent document, we'll call it respLink, with the following formula:

     @DbLookup("";"";"(ResponseLookupView)";
     @Text(@DocumentUniqueID);"myID")

This respLink field will yield a doclink to the response document.

MrMagoo:
Hallo,
die Formel von WFlamme geht, zeigt die ID allerdings als String und nicht als Link an??
Gruß

doliman:
Hi,

wer's braucht:

mit zwei Varianten:
1. mit der Ansicht vom Beitrag oben oder
2. mit set dc = doc.responses

Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim view As NotesView
   Dim dc As notesdocumentcollection
   Dim doc As notesdocument
   Dim rtitem As NotesRichTextItem
   Dim docChild As notesdocument
   
   Set doc = source.document
   Set db = session.currentdatabase
   Set view = db.GetView( "(ResponseLookupView)" )
   
   If Not doc Is Nothing Then
      If doc.HasItem( "unbennant" ) Then  
         Call doc.RemoveItem( "unbennant" )
      End If
      
      Set rtitem = doc.CreateRichTextItem( "unbennant" )
      Set rtitem = New NotesRichTextItem( doc, "unbenannt" )
      
      Set dc = doc.responses
      
      'Set dc = view.getalldocumentsbykey(doc.universalid)
      Set docChild = dc.GetFirstDocument
      While Not ( docChild Is Nothing )
         Call rtitem.AppendDocLink( docChild, docChild.universalid)
         Call rtitem.AddNewLine( 1 )
         Set docChild = dc.GetNextDocument( docChild )
      Wend
      
   End If

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln