Namen aus Verteiler in einem Feld anzeigen lassen

  • Hallo Leute,
    ich habe leider gerade einen kleinen Hänger.


    Ich habe ein Feld in dem steht ein Verteiler. Ich möchte nun in einem anderen Textfeld die Namen aus dem Verteiler anzeigen lassen.
    Wie kann ich das per Formelsprache oder Scriptsprache realisieren.


    Vielen Dank im Voraus


    Bernd99 :)

  • Probier das mal:



    Function GetMembersinGroup(GroupName As String) As Variant
    Dim session As New NotesSession
    Dim db As New NotesDatabase("Servernamet", "Names.NSF")
    Dim doc As NotesDocument
    Dim view As NotesView
    Set view=Db.GetView("($VIMGroups)")
    Set doc=View.GetDocumentByKey(GroupName)
    Redim tmpMembers(1) As Variant
    J=0


    If Not(doc Is Nothing) Then
    tmpGroupName1=Doc.GetItemValue("Members")
    GroupLowerBound1= Lbound(tmpGroupName1)
    GroupUpperBound1= Ubound(tmpGroupName1)
    For i=GroupLowerBound1 To GroupUpperBound1
    tmpGroupName2= GetMembersinGroup(tmpGroupName1(i))
    GroupLowerBound2= Lbound(tmpGroupName2)
    GroupUpperBound2= Ubound(tmpGroupName2)
    Redim Preserve tmpMembers(GroupUpperBound2+J) As Variant
    For K= GroupLowerBound2 To GroupUpperBound2
    tmpMembers(J) = tmpGroupName2(K)
    J=J+1
    Next
    Next
    Else
    Redim tmpMembers(0) As Variant
    tmpMembers(0) = GroupName
    End If


    GetMembersinGroup= tmpMembers
    End Function



    -EDIT
    Keine Garantie. :)

  • Geht mit Formelsprache relativ simpel (grad mal getestet):


    2 Felder erstellen, Feld 1 nenne ich mal Verteiler (Bearbeitbar Addressfeld Dialogbox) und Feld 2 nenne ich Inhalt (berechnet zur Anzeige, Formel: Inhalt, Namen, Mehrfachwerte zulassen). Neben Feld 1 kommt eine Schaltfläche zum Refreshen mit folgendem Code:


    Code
    FIELD Inhalt := Verteiler;
    @PostedCommand([ViewRefreshFields])


    funktioniert dann so daß der Nutzer eine Verteileradresse eingibt oder über das Dialogfeld auswählt und dann auf Refresh klickt. Im Feld Inhalt stehen dann alle Namen.

  • CarstenH


    Hab das gerade mal bei mir ausprobiert.
    Also in meinem berechneten Feld steht nachher immer genau das gleiche drin wie in dem Feld in dem ich den Verteiler auswähle, also nicht die Einzelnamen.


    Entweder fehlt also was bei deiner Beschreibung oder es funktioniert leider doch nicht so einfach.


    Ach ja getestet mit 5.013 und 6.03

  • Beim Feld "Verteiler" fehlt der switch "Look up addresses on document refresh"

    Life is not a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming "Wow, what a ride!!! :evil:
    Beschleunigung ist, wenn die Tränen der Ergriffenheit waagrecht zum Ohr hin abfliessen - Walter Röhrl

  • Dann nimmst du ein verstecktes Feld als "Übergangslösung"


    /edit:
    in der DB stehen die Namen auch gleich im "richtigen" Feld :P

    Life is not a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming "Wow, what a ride!!! :evil:
    Beschleunigung ist, wenn die Tränen der Ergriffenheit waagrecht zum Ohr hin abfliessen - Walter Röhrl

  • stimmt, mit nem 5er Client bringt dir die DB nichts...

    Life is not a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming "Wow, what a ride!!! :evil:
    Beschleunigung ist, wenn die Tränen der Ergriffenheit waagrecht zum Ohr hin abfliessen - Walter Röhrl

  • Erst mal Danke an Tomthecat,


    ich habe mir das meiste aus Deinem Script geklaut und dann wie folgt benutz- für die diees interressiert. :D


    Ich habe einen Button benutzt wie man sieht.


    Sub Click(Source As Button)


    Dim GetMembersinGroup As Variant
    Dim GroupName As Variant
    Dim session As New NotesSession
    Dim db As New NotesDatabase("NotesServerName", "Names.NSF")
    Dim doc As NotesDocument
    Dim view As NotesView
    Dim x As Variant
    Dim gn As Variant

    Dim workspace As New NotesUIWorkspace
    Dim uidoc As NotesUIDocument
    Dim item As NotesItem
    Set uidoc = workspace.CurrentDocument
    Call uidoc.Refresh
    Set note = uidoc.Document
    Set uidoc = workspace.CurrentDocument


    gn = uidoc.FieldGetText( "VerteilerSchulungsliste" )

    ###im Feld "VerteilerSchulungsliste" steht der Verteiler den ich auslesen möchte und dessen Namen(Notesadressen) ich in die Felder: S_Name_0, S_Name_1 usw. eintragen möchte.####


    Set view=Db.GetView("($VIMGroups)")
    Set doc=View.GetDocumentByKey(GN)


    If Not(doc Is Nothing) Then

    GetMembersinGroup= Doc.GetItemValue("Members")



    End If

    GroupLowerBound1= Lbound(GetMembersinGroup)
    GroupUpperBound1= Ubound(GetMembersinGroup)

    Dim text As String
    text = "S_Name_"


    For i =GroupLowerBound1 To GroupUpperBound1
    text = text & i
    Set item=note.ReplaceItemValue(text,GetMembersinGroup(i))
    text="S_Name_"
    Next i


    End Sub




    Nochmals Danke an alle :)


    Gruss


    Bernd

  • Erst mal Danke an Tomthecat,


    ich habe mir das meiste aus Deinem Script geklaut und dann wie folgt benutz- für die diees interressiert. :D


    Ich habe einen Button benutzt wie man sieht.


    Sub Click(Source As Button)


    Dim GetMembersinGroup As Variant
    Dim GroupName As Variant
    Dim session As New NotesSession
    Dim db As New NotesDatabase("NotesServerName", "Names.NSF")
    Dim doc As NotesDocument
    Dim view As NotesView
    Dim x As Variant
    Dim gn As Variant

    Dim workspace As New NotesUIWorkspace
    Dim uidoc As NotesUIDocument
    Dim item As NotesItem
    Set uidoc = workspace.CurrentDocument
    Call uidoc.Refresh
    Set note = uidoc.Document
    Set uidoc = workspace.CurrentDocument


    gn = uidoc.FieldGetText( "VerteilerSchulungsliste" )

    ###im Feld "VerteilerSchulungsliste" steht der Verteiler den ich auslesen möchte und dessen Namen(Notesadressen) ich in die Felder: S_Name_0, S_Name_1 usw. eintragen möchte.####


    Set view=Db.GetView("($VIMGroups)")
    Set doc=View.GetDocumentByKey(GN)


    If Not(doc Is Nothing) Then

    GetMembersinGroup= Doc.GetItemValue("Members")



    End If

    GroupLowerBound1= Lbound(GetMembersinGroup)
    GroupUpperBound1= Ubound(GetMembersinGroup)

    Dim text As String
    text = "S_Name_"


    For i =GroupLowerBound1 To GroupUpperBound1
    text = text & i
    Set item=note.ReplaceItemValue(text,GetMembersinGroup(i))
    text="S_Name_"
    Next i


    End Sub




    Nochmals Danke an alle :)


    Gruss


    Bernd