* Fields
Define Field(#empnof) Reffld(#empno) Desc('First entry on current page')
Define Field(#empnow) Reffld(#empno) Desc('Last entry on current page')
Define Field(#cur_page) Reffld(#std_num) Desc('Current page number')
Define Field(#empfrom) Reffld(#empno) Desc('From Employee')
Define Field(#empto) Reffld(#empno) Desc('To Employee')
Define Field(#total) Reffld(#std_count) Desc('Total entries this search ')
* lists
Def_List Name(#emplist) Fields((#empno *out) (#surname *out) (#givename *out) (#postcode *out) (#phonehme *out)) Counter(#std_count) Type(*Working) Entrys(*max)
* Global MapsMany weblets return a value in the field STDRENTRY, so it usually needs to be mapped as a hidden field. You will add other fields to this global web_map as you develop this WAM.
Web_Map For(*both) Fields((#stdrentry *hidden))
WebRoutine Name(search)
Web_Map For(*both) Fields(#empfrom #empto #emplist)
Case (#stdrentry)
When (= s)
#com_owner.browse I_Empfrom(#empfrom) I_Empto(#empto)
Endcase
Endroutine
Important Note: This WAM, when completed, will comprise around 130 statements. To save time, much of this code is provided. Make sure you review each section of code as it is added, either at the time you are doing it or later. As with all programming tasks, you should approach WAM development a stage at a time, and test your initial code, before moving on to add additional logic. |
Mthroutine Name(browse)
Define_Map For(*input) Class(#empno) Name(#i_empfrom)
Define_Map For(*input) Class(#empno) Name(#i_empto)
Clr_List Named(#emplist)
Select Fields(#emplist) From_File(pslmst) Where((#std_count <= 10) And (#empno < #i_empto)) With_Key(#i_empfrom) Val_Error(*next) Options(*startkey *endwhere)
Add_Entry To_List(#emplist)
If (#std_count = 1)
#empnof := #EMPNO
Endif
#empnow := #EMPNO
Endselect
#cur_page += 1
Endroutine

Property | Value |
|---|---|
caption |
|
left_relative_image_path |
|
on_click_wrname |
|
submitExtraFields |
|
|
Element | Tab_index |
|---|---|
EMPFROM | 1 |
EMPTO | 2 |
Push Button | 3 |

