Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

[ Image Removed |../../index.htm#lansa/wamengt4_0245.htm]
You are here:

...

WAM020 - WAM Navigation
In this step, you will add RDMLX code, defining three WebRoutines.
1.  Immediately following the BEGIN_COM, insert the following RDML code to create three new WebRoutines named NavMain, NavCall and NavTrans:
Webroutine Name(NavMain) Desc('Navigation Home')
Endroutine
Webroutine Name(NavCall) Desc('Navigation CALL')
Endroutine
Webroutine Name(NavTrans) Desc('Navigation TRANSFER')
EndroutineWebRoutineWebRoutine 
2.  Define a List containing EMPNO in WebRoutine NavMain. This list will hold all of the valid employee numbers from the personnel master. You will use this list to populate a dropdown list, so you will only be able to search for an employee that exists. Add the following code in the WebRoutine:
Def_List Name(#EMPLST) Fields(#EMPNO) Type(*WORKING) Entrys(*MAX)
Clr_List Named(#EMPLST)
Select Fields(#EMPNO) From_File(PSLMST)
Add_Entry To_List(#EMPLST)
Endselect 
3.  Add a GROUP_BY immediately following the BEGIN_COM. This will be used in each WebRoutine's WEB_MAP and FETCH commands and to re-set field values to default values.
Group_By Name(#empdata) Fields(#surname #givename #address1 #address2 #address3 #postcode #phonehme #phonebus #deptment #section #salary #startdte #termdate)
 
     Hint: Use the F4 Command Assistant  to define the Group_By. Use the Fields in File tab to select fields from file PSLMST.
4.  All fields in the WebRoutine NavMain will be both incoming and outgoing, so they will be specified FOR(*BOTH). All of the fields from PSLMST will be used.
     By default, all the fields will be displayed as input fields.
     The EMPLST list should be mapped with a *PRIVATE attribute, because it will be used to populate the combo box weblet for EMPNO.
     Add the following  WEB_MAP statement to the WebRoutine NavMain:
WEB_MAP FOR(*BOTH) FIELDS(#EMPNO #EMPDATA (#EMPLST *PRIVATE))
 

...

     Add the following WEB_MAP statements to the WebRoutine:
Web_Map For(*BOTH) Fields(#EMPNO) Web_Map For(*OUTPUT) Fields(#EMPDATA)
 
11. Add the FETCH to NavCall.
Fetch Fields(#EMPDATA) From_File(PSLMST) With_Key(#EMPNO)
 
     Your finished NavCall WebRoutine should appear as follows:
Webroutine Name(NavCall) Desc('Navigation CALL') Web_Map For(*BOTH) Fields(#EMPNO) Web_Map For(*OUTPUT) Fields(#EMPDATA) Fetch Fields(#EMPDATA) From_File(PSLMST) With_Key(#EMPNO) Endroutine 
12.  Create the WEB_MAP for WebRoutine NavTrans. These WEB_MAPs will be identical to NavCall.
Web_Map For(*BOTH) Fields(#EMPNO) Web_Map For(*OUTPUT) Fields(#EMPDATA)
 
13. Add the FETCH, set STDRENTRY to 'D' and TRANSFER back to NavMain.
Fetch Fields(#EMPDATA) From_File(PSLMST) With_Key(#EMPNO) #STDRENTRY := 'D' Transfer Toroutine(NavMain)
 
     Your finished NavTrans WebRoutine should appear as follows:
Webroutine Name(NavTrans) Desc('Navigation TRANSFER') Web_Map For(*BOTH) Fields(#EMPNO) Web_Map For(*OUTPUT) Fields(#EMPDATA) Fetch Fields(#EMPDATA) From_File(PSLMST) With_Key(#EMPNO) #STDRENTRY := 'D' Transfer Toroutine(NavMain) Endroutine
 
14.  Save Save and compile the WAM.
[ Image Removed |../../index.htm#lansa/wamengt4_0245.htm]