On Enter Event

Hi All

Is there an equivelant to the OnEnter event for a field within Lotus Notes?

So when the enter key is pressed a piece of code runs? Also is it possible to covert the following into either Lotusscript or Java?

@If(Description = “”;@SetField(“Testing”; @PickList( [Custom] : [Single] ; @DbName ; “PickList” ; “Select a product” ; “Please select the products you want to order” ; 1 ));@SetField(“Testing”; @PickList( [Custom] : [Single] ; @DbName ; “PickList5” ; “Select a product” ; “Please select the products you want to order” ; 2 ; Description )));

@SetField(“FieldValue0”;@DbLookup( “” ; “” : “” ; “Picklist” ;Testing ; 1 ));

@SetField(“FieldValue1”;@DbLookup( “” ; “” : “” ; “Picklist” ;Testing ; 2 ));

@SetField(“FieldValue2”;@DbLookup( “” ; “” : “” ; “Picklist” ;Testing ; 3 ))

Regards

Douglas Bell

Subject: On Enter Event

Yes, there is two events; Entering (used for pure LotusScript) and onFocus (for both web and Notesclient code; JavaScript or LotusScript).

The code could look something like:

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim db As NotesDatabase

Dim vw As NotesView

Dim coll As NotesDocumentCollection

Dim doc As NotesDocument



Set uidoc = ws.CurrentDocument

Set db = ws.CurrentDatabase.Database

Set vw = db.GetView("Picklist")



If uidoc.FieldGetText("Description") = "" Then

	retval = ws.PickListStrings(PICKLIST_CUSTOM,False,"",ws.CurrentDatabase.Database.FileName,"Picklist5","Select a product","Please select the products You want to order",1)

Else

	retval = ws.PickListStrings(PICKLIST_CUSTOM,False,"",ws.CurrentDatabase.Database.FileName,"Picklist5","Select a product","Please select the products you want to order",2,uidoc.FieldGetText("Description"))

End If

Call uidoc.FieldSetText("Testing",retval)



Set coll = vw.GetAllDocumentsByKey(uidoc.FieldGetText("Testing"),True)

If coll.Count > 0 Then

	Set doc = coll.GetFirstDocument()

	Call uidoc.FieldSetText("FieldValue0",doc.NameOfField1(0))

	Call uidoc.FieldSetText("FieldValue1",doc.NameOfField2(0))

	Call uidoc.FieldSetText("FieldValue2",doc.NameOfField3(0))

End If

Call uidoc.Refresh(False)

’ — CODE END —

All You have to do is to change the “NameOfField1”, “NameOfField2” and “NameOfField3” to the correct fieldnames that columns 1, 2 and 3 is displaying in the “Picklist” view that You are doing a lookup on.

hth