Step 3. Modify Department Dropdown
VFW074 – Create a Compound Reusable Part
1. A change is required to iiiVFW13 to signal when the departments dropdown is . The existing routine is as follows:
Evtroutine Handling(#CMBX_1.Initialize) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Clr_List Named(#CMBX_1)
Select Fields(#CMBX_1) From_File(deptab)
Add_Entry To_List(#CMBX_1)
Endselect
Get_Entry Number(1) From_List(#CMBX_1)
If_Status Is(*okay)
#CMBX_1.currentItem.focus := true
Endif
Endroutine
Although the program is setting for the first entry, this will not signal an event.
2. Add code to signal the event, as follows. New code is shown in red, italics.
Evtroutine Handling(#CMBX_1.Initialize) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Clr_List Named(#CMBX_1)
Select Fields(#CMBX_1) From_File(deptab)
Add_Entry To_List(#CMBX_1)
Endselect
Get_Entry Number(1) From_List(#CMBX_1)
If_Status Is(*okay)
#CMBX_1.currentItem.focus := true
Signal Event(uDepartmentChanged)
Endif
Endroutine
3. Compile iiiVFW13.