Step 9. Add Logic for Employee Notes

This step will add logic to populate the NotesList.

1.  Paste the working list, xEmployeeNotesList into the web page.

2.  Create a GetNotes method routine to perform the following:

Define a component for xEmployeeNotesDataServer / FindxEmployeeNotesBy srvroutine, named GetNotes

Clear list NotesList

Execute GetNotes asynchronously, exchanging Employee ID and list xEmployeeNotesList

Within an event routine for GetNotes.Completed

Select all entries in list xEmployeeNotesList

   Add each entry to NotesList

End Select

End routine

     Your code should look like the following:

Mthroutine Name(GetNotes)

Define_Com Class(#iiixEmployeeNotesDataServer.FindxEmployeeNotesBy) Name(#GetNotes)

Clr_List Named(#NotesList)

#GetNotes.ExecuteAsync( #xEmployeeIdentification #xEmployeeNotesList )

Evtroutine Handling(#GetNotes.Completed)

Selectlist Named(#xEmployeeNotesList)

Add_Entry To_List(#NotesList)




3.  Add code to the GetEmployee routine to invoke the GetNotes method routine.

     Your code should look like the following:

Mthroutine Name(GetEmployee)

Define_Map For(*INPUT) Class(#xEmployeeIdentification) Name(#EmployeeID)

Define_Com Class(#iiixEmployeeDataServer.find) Name(#GetEmployee)

#xEmployee := *null

#GetEmployee.ExecuteAsync( #EmployeeID #xEmployee #IO$STS )

Evtroutine Handling(#GetEmployee.Completed)




4.  Compile your web page.

5.  Test your web page. Remember, not all employees will have notes.

     Search for employees and select an employee in the EmployeesList. When employee details are shown on the Detail tab sheet, select the Notes tab sheet. In most cases, this should contain a list of notes.