[ |../../index.htm#lansa/wbfeng01_0455.htm]
You are here:

Step 7. Retrieve Employee Details

This step will add a new srvroutine to the iiixEmployeeDataServer server module, which returns details for a single employee and a list of the employee's notes. This will enable the required employee data to be retrieved with one trip to the server.
In the web page, you will then create a GetEmployee method, which is invoked from the EmployeeList.ItemGotSelection event.
1.  Open the server module iiixEmployeeDataServer in the editor.
2.  Define working list xEmployeeNotes, for fields xEmployeeNoteGUID, xEmployeeNoteCreateUpdate and xEmployeeNote, with Entrys(*max).
Def_List Name(#xEmployeeNotes) Fields(#xEmployeeNoteGUID #xEmployeeNoteCreateUpdate #xEmployeeNote) Type(*Working) Entrys(*MAX)
3.  Copy the srvroutine Find to create srvroutine FindDetails.
4.  Extend FindDetails as follows:
Add an output map for the list xEmployeeNotes
Add a Val_error(*next) parameter to the FETCH statement
If status is OK
Select list xEmployeeNotes from logical xEmployeeNotesByEmployee with key xEmployeeIdentification
Add all entries to list xEmployeeNotes
End select
     Your code should look like the following:
Srvroutine Name(FindDetails)
Field_Map For(*Input) Field(#xEmployeeIdentification)
Group_Map For(*Output) Group(#xEmployee)
List_Map For(*OUTPUT) List(#xEmployeeNotes)
Field_Map For(*Output) Field(#IO$STS) Parameter_Name(Status)