Page History
...
- Your AddSect WebRoutine will handle the initial call from the Begin web page in iiiSecMaint and the call from the Save button' on the AddSect web page itself.
...
- Create your logic for WebRoutine AddSect based on the following pseudo code:
CASE of STDRENTRY
* when called from Begin WebRoutine
When = N
Change DEPTMENT to DEPT_IN (value passed in from iiiSecMaint)
Change SECTION to *null (value is passed in from iiiSecMaint)
* when Save button clicked
When = A
Change DEPTMENT to DEPT_IN (the input value on the web page)
Insert to Section file
If Status is *OKAY
Output message
Change STDRENTRY to L
Transfer to WebRoutine iiiSecMaint.Begin
Endif
Endcase
...
Your completed RDMLX code should look like the following:
...
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_WAM) Layoutweblet('iiilay01')
Group_
...
By Name(#SECT_DETL)
...
Fields((
...
#DEPTMENT *hidden)
...
#SECTION #SECDESC #SECADDR1 #SECADDR2 #SECADDR3 #SECPCODE #SECPHBUS)
Define Field(#dept_in)
...
Reffld(#deptment)
Web_
...
Map For(*BOTH)
...
Fields((
...
#STDRENTRY *HIDDEN))
...
WebRoutine Name(ADDSECT)
...
Desc('
...
ADD SECTION')
Web_
...
Map For(*BOTH)
...
Fields(#dept_
...
in #SECT_DETL)
...
Case Of_Field(#STDRENTRY)
...
* New button clicked in iiiSecMaint
When (= N)
#deptment := #dept_in
#SECTION := *NULL
* Add button clicked
When (= A)
#deptment := #dept_in
Insert Fields(#SECT_DETL)
...
To_File(SECTAB)
...
Val_Error(*NEXT)
...
#STDRENTRY :=
...
*NULL
If_
...
Status Is(*OKAY)
...
Message Msgtxt('
...
Section successfully added')
...
#stdrentry := L
Transfer Toroutine(#iiiSecMaint.BEGIN)
Endif
Endcase
Endroutine
End_
...
Com
...
- Compile your WAM and open in the Design view. It should look like the following:
...
- If necessary change the Department Code to an input field. Drop an AutoComplete weblet onto the department field value. Set up the weblet properties based on:
Property
Value
sourceWamName
iiiSecMaintsourcewrName
AutoCompletelistName
DEPTSvalueField
DEPTMENT
...
Note that the AutoComplete weblet is calling the response WebRoutine you created in WAM iiiSecMaint.
...
- The Section field should be an input field, change it if necessary.
...
- Add a row to the bottom of the table and add a push button with image to the right hand cell. Make the cell right align. Set up the push button properties as shown:
Property
Value
caption
Saveleft_relative_image
icons/normal/16/check_mark_16.pngon_click_wrname
AddSectsubmitExtraFields
Field Name: STDRENTRY
...
Literal Value: A
...
- Save these changes. Your completed AddSect page should look like the following:

