<!--QuoteBegin-Sandr+2:11:2007, 15:52 -->
<span class="vbquote">(Sandr @ 2:11:2007, 15:52 )</span><!--QuoteEBegin-->В таком случае, приведеный выше код работать должен... итем там один.. значений у него просто много... перебирайте значения...[/quote]
Не, работать оно не должно. Оказывается в ИБМе это известный глюк, вот нашел у них на сайте, может кому пригодиться
<!--QuoteBegin- How to get a handle to individual entries contained within multiple item entries Technote (FAQ) +-->
<span class="vbquote">( How to get a handle to individual entries contained within multiple item entries Technote (FAQ) )</span><!--QuoteEBegin-->Problem
You have a Notes document that contains two or more items of the same name and that each contain different values. You would like to be able to display each of these item values as individual entries in a view.
Duplicate document items are most commonly seen in mail documents that originate from the Web. When e-mails from the Web reach their destination in a Notes mail file, they often have several "Received" items that have been created at each hop of the e-mails transmission. The only thing that distinguishes these items is a "Dup Item ID". These duplicate IDs are sequential and are assigned each time another instance of the item is created.
Solution
There is currently no @Formula or direct functionality to separate and view data from duplicated items. However, the following LotusScript agents can be used or modified as a workaround:
Note: The following scripts were written for testing and are set to act on only the first document in a view. Additional modifications would have to be made to each of these scripts depending on your environment and what you want to accomplish. Notes Support is not available to further customize these examples.
The following sample script runs through each "Received" item, copies the value to a new unique field and then removes the original item. This script would be used if the user wants to display each of these new fields in separate columns of a view. In order to access each item, this script has to permanently remove all original "Received" items.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim OldRcvd As NotesItem
Dim NewRcvd As NotesItem
Set db = session.currentdatabase
Set view = db.GetView("TempView")
Set doc = view.GetFirstDocument
Set OldRcvd = doc.getfirstitem("Received")
Dim x As Integer
x = 0
Do Until OldRcvd Is Nothing
x = x + 1
Set NewRcvd = doc.CopyItem(OldRcvd,"Received_" + Cstr(x))
NewRcvd.IsSummary = True
Call OldRcvd.Remove
Set OldRcvd = doc.getfirstitem("Received")
Loop
Call doc.save(True,True)
End Sub
The second sample script does essentially the same as the first, except that it puts all the original "Received" values into one field (TmpReceived) as separate values. This script would be used if the user wants to display each of the values in the same column of a view by using Column Property "Show Multiple values as separate entries". In order to access each item, this script has to permanently remove all original "Received" items.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim OldRcvd As NotesItem
Dim NewRcvd As NotesItem
Redim TmpArray(0 To 50) As String
Set db = session.currentdatabase
Set view = db.GetView("TempView")
Set doc = view.GetFirstDocument
Set OldRcvd = doc.getfirstitem("Received")
Dim x As Integer
x = 0
Do Until OldRcvd Is Nothing
TmpArray(x) = OldRcvd.values(0)
Call OldRcvd.Remove
Set OldRcvd = doc.getfirstitem("Received")
x = x + 1
Loop
Redim Preserve TmpArray(0 To x-1) As String
Set NewRcvd = doc.ReplaceItemValue("TmpReceived", TmpArray)
NewRcvd.IsSummary = True
Call doc.save(True,True)
End Sub
The following example demonstrates how you can place the values back into a multi-item field. Use the example below if you want revise the Received data so that it only contains the last 5 entries or the first 5 entries (for example). You can accomplish this using the AppendItemValue method (of the NotesDocument class) which creates a second item when applied to a item that already exists.
The following code example relies on the code from the first example, and is placed between the Loop call and the Save call:
For i=1 To x
If i<=5 Then 'Use this line if you wanted to preserve only the first 5 items
If i>(x-5) Then 'Use this line if you wanted to preserve only the last 5 items
Set newrcvd=doc.getfirstitem("Received_"+Cstr(i))
If Rcvd Is Nothing Then
Set Rcvd =doc.CopyItem(NewRcvd, "Received")
Rcvd.IsSummary = True
Else
Call doc.appenditemvalue("Received", newrcvd)
End If
End If
Call doc.removeitem("Received_"+Cstr(i))
Next
Call doc.save(True,True)[/quote]