Help with setting a field in lotus script!

Hi!

Can someone please help me!

How do I give a field on my form a value in lotus script? I have a field named status on my form and on my submit- button I have lotus script code that among other things saves and closes the form when you press it! I would like the button to also set a value in my status field… I hope you understand my question!

Here is my code so far:

Sub Click(Source As Button)

' Declare all variables

Dim workspace As New NotesUIWorkspace

Dim session As New NotesSession

Dim uidoc As NotesUIDocument

Dim view As NotesView

Dim db As NotesDatabase

'Set all variables

Set uidoc = workspace.CurrentDocument

Set db = session.CurrentDatabase

Set view = db.GetView( "§DocumentNo" )

'Save current document, refresh “§DocumentNo” view

'and close document

Call uidoc.Save

Call view.Refresh

Call workspace.ViewRefresh	

Call uidoc.Close

End Sub

Thank you!

//Sandra

Subject: Help with setting a field in lotus script!

I think something like this would do it:

Sub Click(Source As Button)

’ Declare all variables

Dim workspace As New NotesUIWorkspace

Dim session As New NotesSession

Dim uidoc As NotesUIDocument

Dim Doc as NotesDocument

Dim view As NotesView

Dim db As NotesDatabase

'Set all variables

Set uidoc = workspace.CurrentDocument

Set Doc = uidoc.Document

Doc.Status = “YourValue”

Call Doc.Save(True, False)

Set db = session.CurrentDatabase

Set view = db.GetView( “§DocumentNo” )

'Save current document, refresh “§DocumentNo” view

'and close document

Call uidoc.Save

Call view.Refresh

Call workspace.ViewRefresh

Call uidoc.Close

End Sub

Subject: RE: Help with setting a field in lotus script!

You can also use:

uidoc.fieldsettext(“stringFieldName”, “stringToInsertInField”)

in the UI classes if you have the doc open in edit mode.

Shawn

Subject: RE: Help with setting a field in lotus script!

Thank you for your help!

I appreciate it :slight_smile:

//Sandra

Subject: RE: Help with setting a field in lotus script!

Thank you for your help!

I appreciate it :slight_smile:

//Sandra