Pb with fieldsettext

hello everyone,

i have the following code in a postopen statement, that should put a value to get a count of the document, but the fieldsettext doesn’t put any value, with the script debugger, var has a the correct value, but nothing happend to my source.doccount (text field editable)

Sub Postopen(Source As Notesuidocument)

Dim session As New NotesSession

Dim db As NotesDatabase

Dim view As NotesView

Dim doc As NotesDocument

Dim var As String

Set db = session.CurrentDatabase

Set view = db.GetView( "doc count")

Set doc = view.GetLastDocument

var = doc.num(0) +1

Call source.FieldSetText ( "doccount" , var)

End Sub

thanks for all help

Subject: Pb with fieldsettext

I think the PostOpen won’t work, as you are not in edit mode and therefore cannot change a field in the UI.What you could do is changing it in the Backend using ReplaceItemValue, but I am not sure if this will result in Replication conflicts if the user later wants to save the document.

Regards, Michael

Subject: Pb with fieldsettext

you cannot stamp values to a document unless it is in the edit mode but you could always compute them. i.e.try computing the value using @DbColumn or @DbLookup.

something like

var:=@DbColumn(“”;“”;“doc count”;1);

@Elements(var) + 1