Hi all, I have a form , to be sent to a group of employees.
When the form is opened, one field of the form must collect value from his previous records and populate it...
So, i collected his last document from the view by passing his name as key...
This works 5n....
But my workflow goes like this... When he saves and submits the form, the form is sent as a doclink to his head..here comes the problem where , when the doclink is clicked to open , the current cycle's employee details are retrieved and showed in the form... I want the previous cycle details to be maintained there till I close the complete cycle...
Even tried using a separate code in a button to open the form first time but, how can i pass his name as key without opening the form...
I’m new to Lotus so, guide me …Need your suggestions…
thanks Kiran…But, on form loading, its prompting notes error as “Field value cannot be edited”… how can i overcome this… I s there any field properties to be enabled ?
I’m attaching my code here…Read my first post so that u could understand what I’m facing on…
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim entry As NotesViewEntry
Dim nav As NotesViewNavigator
Dim doc As NotesDocument
Dim dc As NotesDocumentCollection
Dim item As NotesItem
Dim val1,val2,val3,val4,val5 As Variant
key = source.FieldGetText("emp_name")
Set db = session.CurrentDatabase
Set source=ws.CurrentDocument
Set view = db.GetView ("future" )
Set dc=view.GetAllDocumentsByKey(key,True)
If dc.Count>0 Then
Set doc = dc.GetLastDocument
While Not doc Is Nothing
val1=doc.Getitemvalue("fut_obj1")(0)
val2=doc.GetItemValue("fut_obj2")(0)
val3=doc.GetItemValue("fut_obj3")(0)
val4=doc.GetItemValue("fut_obj4")(0)
val5=doc.GetItemValue("fut_obj5")(0)
'Set doc1=source.document
'Call doc1.ReplaceItemValue("obj1",val1
Call source.FieldSetText("obj1",val1)
Call source.FieldSetText("obj2",val2)
Call source.FieldsetText("obj3",val3)
Call source.FieldsetText("obj4",val4)
Call source.FieldsetText("obj5",val5)
Exit Sub
Wend
End If
Set source=ws.EditDocument(True)
This I'm writting "on Load". so when the head opens the form, the from is loaded with current cycle's objective and not the previous one..