Step 1. Create iiiFN13 – Contact Us
In this step, you will create function iiiFN13 Contact Us in process iiiPROC03. This function will simply request data using an input text area and then it will display the contents of the fields after the data apportionment has taken place.
1. Working with your iiiPROC03 process, create a new function named iiiFN13 Contact Us. You will manually enter the code for the function.
2. Write the RDML Code to perform the following tasks:
- Define a field called iiiCOMENT to be used for Web page component substitution.
- Define three fields named COMMNT, COMMNT001, and COMMNT002. These fields will be used as the input fields from the text area. Fields are alpha, length 20.
- Define three fields named COMOUT, COMOUT001, COMOUT002. These fields will be used to display the values of the COMMNT fields.
- Change the values of COMOUT, COMOUT001, AND COMOUT003 to the values of COMMNT, COMMNT001 AND COMMNT002.
- Change COMMNT, COMMNT001, COMMNT002 fields to *BLANKS.
- Request the page component iiiCOMENT. Include a SUBMIT user key which will call iiiFN13 (re-entrant WEBEVENT function).
Solution:
One possible solution to this exercise is shown below (where iii is your course assigned ID):
FUNCTION (*DIRECT *WEBEVENT)
DEFINE FIELD(#iiiCOMENT) TYPE(*CHAR) LENGTH(1)
DEFINE FIELD(#COMMNT) TYPE(*CHAR) LENGTH(20)
DEFINE FIELD(#COMMNT001) TYPE(*CHAR) LENGTH(20)
DEFINE FIELD(#COMMNT002) TYPE(*CHAR) LENGTH(20)
DEFINE FIELD(#COMOUT) TYPE(*CHAR) LENGTH(20)
DEFINE FIELD(#COMOUT001) TYPE(*CHAR) LENGTH(20)
DEFINE FIELD(#COMOUT002) TYPE(*CHAR) LENGTH(20)
CHANGE FIELD(#COMOUT) TO(#COMMNT)
CHANGE FIELD(#COMOUT001) TO(#COMMNT001)
CHANGE FIELD(#COMOUT002) TO(#COMMNT002)
CHANGE FIELD(#COMMNT #COMMNT001 #COMMNT002) TO(*BLANKS)
REQUEST FIELDS((#iiiCOMENT *NOID)) EXIT_KEY(*NO) MENU_KEY(*NO) USER_KEYS((01 SUBMIT))
3. Exit and save your RDML function.
4. Do not compile the function at this time.