Exercises – DAY 1
Find / Browse Form Exercise:
Purpose is to create an address book application. This application will have one Find/Browse Form and one Fix/Inspect form.
Learning Objectives:
After completing this exercise, you will be able to: Create Table Create Business View Create a UDC Create an application Select a Find/Browse Form Type Attach Business View to the form Select Form Properties and Form Options Set focus on the form and the grid Add form and grid fields Move and size controls Add filter fields Add Menu/Toolbar exits Test a form
1. Create a new project DME00052. Create a new table F5501010 (Class Address Book Master)
a. Column Prefix: AB3. Use following DD Items.
a. AN8 (PK)b. AT1c. ALPHd. ADD1e. ADD2f. CTY1
g. ADDSh. ADDZi. ACTIVEY
Nj. CTRk. AC01
l. SALm. USERn. PIDo. JOBNp. UPMJq. UPMT
4. Create a new table F5501011 (Class Phones)a. Column Prefix: PH
5. Use following DD Itemsa. AN8 (PK)b. LNID
(PK)c. AR1
d. PH1e. PHTPf. ALPHg. USER
h. PIDi. JOBNj. UPMJk. UPMT
6. Create a new Business View V550101 (Class Address Book – All Columns)a. Base this Business View upon F5501010
7. Create a new Business View V550102 (Class Phones – All Columns)a. Base this Business View upon F5501011
8. Create a UDC 55/RE (Region). The Code length should be 2a. CE - Centralb. NE - Northeastc. NW - Northwestd. SE - Southeaste. SW - Southwest
9. Create a new application P5501001 (Class Address Book)10. Select Find/Browse Form11. Give this form the title “Work With Addresses”12. Attach Business View V550101
13. Add Search Type and Alpha Name as Form Controls by selecting Insert from the Menu bar, then Business View Fields
14. Change Alpha Name label to Name on both Form and Grid. Change ST to State on Grid
15. Change filter criteria for the two filter controls:a. FC Search Type should be set to ‘=’b. FC Name should be set to ‘>=’
16. Align Search Type and Name Controls17. Attach an associated description to Search Type field on Form Control
18. Give a default value to search type field. The default value should be ‘E19. Add following Grid Columns from Business view
a. AN8b. AT1c. ALPHd. CTY1e. AC01
20. Give appropriate descriptions, as shown on the above screenshot21. Apply UDC override on AC01. Attach AC01 to the custom UDC 55/RE22. Increase width of the grid columns so that it matches the form illustration.23. Create a group box around Search Type and Name24. Add Delete and Add buttons to the tool bar25. Set the tab sequence26. Test the form27. Save the form and Exit
28. Run P5501001 from fast path
CONGRATULATIONS!!! You have successfully created your first Find/Browse Form
Exercise Fix & Inspect Form
After you’ve created the Table and Business View objects and the Find/Browse Form, which is the entry point to the application, you will use the Application Design Aid to create a second form used to maintain the Class Address Book records.
Learning Objectives
Upon completion of this exercise, you will be able to: Select a Fix/Inspect Form Type Attach a Business View Utilize Tab Control Add form controls Associate Descriptions Move and size controls Add Data Dictionary fields Describe how to distinguish between Data Dictionary field and
Business View field on the form Disconnect control text from control variables Explain alignment options
1. Go into the design of P55010012. Select Fix/Inspect form from form types and give
the title “Address Book Revisions”3. Apply Size to Guide from Layout option4. Attach Business View V5501015. Create two Tab Controls as shown in the following
forms:
Address Book Revisions (Fix / Inspect) Form – Address Tab
Address Book Revisions (Fix/Inspect) Form – Employee Tab
Top of Form:
6. Add Address Number, Alpha Name and Search Type as Business View Fields
7. Align Address Number and Alpha Name 8. Change Alpha Name to Name9. Add an Associated Description for Search Type10. Create a Group Box
Address Tab Layout
11. Add Address Line 1, Address Line 2, City, State, Postal Code, Country, and Category Code or (Region) as Business View fields on “Address Tab” page
12. Change Address 2 to Street Address13. Disconnect and clear the static text from the
Address Line 2 control14. Disconnect the static text from the controls for
State and Postal Code so that you can clear the text and move the controls
15. Change the static text for City to City/State/Postal and move the State and Postal Controls next to the City Control
16. Add Associated Descriptions for County and Region
Employee Tab Layout
17. Insert Monthly Salary as a Business View Field18. Add a control for Annual Salary by inserting a Data
Dictionary Field. Select Math01 from the Data Dictionary Browser and rename the Control Description of Math01 to Annual Salary
19. Disable the Annual Salary control by accessing the control properties.
Form Properties
20. Set the Tab Sequence in a logical manner21. Test the form
Form Interconnect
22. Go back to Work With Addresses Form (W5501001A)
23. Go to Menu/Toolbar Exits24. Go To Event Rules of &ADD Button25. Click on Form Interconnect Control26. Call P5501001/W5501001B form27. Click Ok without passing any value in to data
structure28. Click Ok again to come out of Event Rules Window29. Select &Select option from Menu/Toolbar Exits30. Repeat steps 25 and 2631. Select GC Address Book parameter from available
objects and pass it to FI Address Book Data Structure32. Click OK to save33. Click Ok to close34. Save and Exit
CONGRATULATIONS!!! You’ve successfully created a Fix/Inspect form
Exercise – Day 2
Event Rule Exercise:
Learning Objectives:
Create conditional If/Then/Else statements Create assignments Create Event Rule Logic to hid and show controls based on
condition Use Event Rules to perform calculation Use System Functions Place Check Boxes and assign DD Item to those Check Boxes. Put
logic behind those Check Boxes
Steps to complete the exercise1. Display Monthly and annual salary controls only if the
address book record is for an employee. 2. On an Add, the Employee tab on the form should initially
appear like this:
3. If the user enters Search Type of E, the form should display the Monthly Salary and Annual Salary controls:
4. If a Monthly salary is entered, the annual salary should be calculated automatically:
Hint: This logic needs to occur on multiple events
5. On work with Address Book Form, put logic on an appropriate event, which will put a ‘Yellow’ color on all the lines on Grid that have a search type ‘E’ on it.
Hint: Choose appropriate SYSTEM FUNCTION from available functions in the Grid System Functions Option
CHECK BOX EXERCISE
6. Put two CHECK BOXES on Work With Addresses form as shown on the above picture.
7. Attach both check boxes to DD Item (EV01)8. Give appropriate descriptions to the Check Boxes. Such as
Display City and Display Region9. Put logic so that when ‘Display City’ check box is CHECKED,
the column CITY displays on the Grid. Otherwise it should be hidden10. Similarly when ‘Display Region’ Check Box is CHECKED, the
columns REGION displays on the Grid. Otherwise it should be hidden
Hint: Choose System Function “HIDE/SHOW GRID COLUMNS” to hide or show the Grid Columns
RADIO BUTTON EXERCISE
1. Insert two Radio Buttons on W5501001B (Address Book Revisions) form
2. Associate both the Radio Buttons with database item ACTIVEYN3. Change the title and value for each radio button
a. Active = Yb. Inactive = N
4. Create a Group Box around the radio buttons5. Save and Exit 6. Run the application to test
HINTS
To Hide/Display Salary and Annual Salary Fields
On Post Dialogue is Initialized Event, put following code
If FC Search Type is equal to "E" Show Control(FC Salary) Show Control(FC Annual Salary) Else Hide Control(FC Salary) Hide Control(FC Annual Salary) End If
On Search Type Control, Control Exited and Changed/Inline event, put following code
If FC Search Type is equal to "E" Show Control(FC Salary) Show Control(FC Annual Salary) Else Hide Control(FC Salary) Hide Control(FC Annual Salary)End If
To calculate annual salary
On CONTROL: EDIT Salary EVENT: Control is Exited, put following code
FC Annual Salary = [FC Salary]*12
To put Check Box Logic
On CONTROL: CHKBOX Display City, EVENT: Selection Changed, Put following logic
If FC Display City is equal to <Zero> Hide Grid Column(FC Grid, GC City)Else Show Grid Column(FC Grid, GC City)End If
On CONTROL: CHKBOX Display Region, EVENT: Selection Changed, Put following logic
If FC Display State is equal to "0"Hide Grid Column(FC Grid, GC Region)
ElseShow Grid Column(FC Grid, GC Region)
End If
To put Color Logic
On EVENT: Write Grid Line-Before, put following logice
If GC SchTyp is equal to "E"Set Grid Color(FC Grid, <Currently Selected Row>, <All Columns>,
<Yellow>)End If
Exercise – Day 3
Headerless Detail Application:
Learning Objectives:
Upon completion of this exercise you will be able to: Create a Headerless Detail Form Attach a Business View Sort the grid by line number Add a filter (no wildcard) for Address Number Disable the Address Number control Create an auto find on grid Add a Delete button Call a Message Box Form Test the form
NOTE: Refer to the screenshot on next page
1. Create a new Headerless Detail form in P5501001 application (Phone Numbers Revisions)
2. Attach Business View V5501023. Add Address Number as a Form control
a. Address Number should have a FILTER option of ‘=’b. Disable this control
4. Create a group box around Address Number5. Add the following grid columns and give appropriate descriptions to
columnsa. AR1 (Area Code)b. PH1 (Phone Number)c. PHTP (Phone Type)d. LNID (Line Number)
6. Set grid properties to “AUTOMATICALLY FIND ON ENTRY”7. Add “DELETE” button on toolbar8. Set form properties to “END FORM ON ADD”9. Set logical tab sequence10.Test the form11.Save the form
Form Interconnect
1. Go to P5501001 and choose work with Address Book form2. Go to Menu/Tool bar3. Add a Row Exit from Class Options4. Add a User Defined from Class Options and name it “Phones”5. Go to Event Rules Window6. Connect P5501001/W5501001A form to P5501001/W5501001E form7. Pass Address Number value into the data structure (Think which
address number value should be passed in. Is it going to be FC or GC?)
8. Save and close9. Go back to W5501001E form and assign the FC Address Number to FI
Address Number. Choose an appropriate event to do this.10.Save and close11.Test your application. Try to add records in your application. Come
back and see if those records exist.
Using Event Rule Variables for Automatic Line Numbering
Business Purpose:In the address book application, the phones screen requires line
numbers. Up to this point, when we added phone number, we entered the associated line numbers manually. This time, we will add logic so that Line ID field will automatically fetch next nember.
Steps to Complete
1. Focus on W5501001E (Phone Numbers) application2. Create a variable LNID (Scope of the variable should be Form)3. In the Name box, change the User Name to
LineNumberCounter_LNID4. Initialize variable on the appropriate event5. To initialize variable, create following assignment
a. VA frm_LineNumberCounterLNID = 06. Next, as each line is retrieved from the database, check to see if the
Line Number of that record is greater than the value of the variable. If it is greater, assign the value of the Line Number to the variable. This ensures that the variable will always be equal to the highest line number in the table before it is incremented by 1 for the final line in the grid. Use appropriate event. Hint of the code at the end of the Document.
7. Finally, increment the variable by 1 and assign the new value to the next available line. Use the appropriate event. Hint of the code at the end of the Document.
8. Disable the Line Number control in the grid.9. Save and Exit the application. Test the application
Create a Message Box Form
1. Go into the design of P5501001 and insert a new Message form from form type and call it “Confirm Delete”
2. Type the following statement on the Event Rules Title“You are about to delete phone numbers. Are you sure?”
3. Attach ‘Yes’ and ‘No’ push buttons to the form4. Go to W5501001E (Phone Numbers Inquiry) form and on the ‘Delete’
Button, call this Message box form. 5. Save and close the application6. Test the application
f Search & Select Form
Learning Objectives
Create a Search and Select form Understand why Search and Select forms usually have their own
business views Attach the Search and Select form to a data dictionary item Test the form
1. Create a new Business View V550103 (Class Address Book – Search & Select)
2. Attach F5501010 to this Business View
3. Show following columnsa. AN8b. AT1c. ALPH
4. Create a new application P550100S (Class Address Book Search & Select)
5. Choose search and select form from form types after you go into the design
6. Attach Business View V5501037. Add Alpha Name and Search Type as Form Controls
a. Alpha Name should have ‘>=’ filter and Wildcard should be set to ‘Yes’
b. Search Type should have Filter option of = and Set Wildcard to ‘Yes’
c. Align search type and alpha named. Add associated description to Search Typee. Create group box around alpha name and search type
8. Add the following grid columnsa. Address Numberb. Alpha Namec. Search Type
9. Sort grid by Address Number10. Set appropriate tab sequence11. Set the form as ENTRY POINT in form properties12. Save and Exit13. Run the application from Fast Path
Note: This application must be checked in so that the Search and Select form is available for the Data Dictionary Item that it needs to get attached to. As this can’t be done on demo, we may not be able to test it successfully. But this should give you an idea of how to create a search and select form.
HINTS
HINT STEP 6: Use the form event GRID RECORD IS FETCHED Put following logic
If BC Line Number is greater that VA frm_LineCounterNumber_LNID
VA frm_LineCounterNumber_LNID = BC Line NumberEnd If
HINT STEP 7 Use the grid event Add Last Entry Row to Grid Use the following logic
Va frm_LineCounterNumber_LNID = [VA frm_LineCounterNumber_LNID]+1
GC LineNumber=VA frm_LineCounterNumber_LNID
Top Related