Skip to content

Commit 67de580

Browse files
authored
forms-to-apex WMS ID - 11716 (#187)
* forms-to-apex * oci-doc
1 parent b27ed8e commit 67de580

File tree

380 files changed

+1742
-53
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

380 files changed

+1742
-53
lines changed
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Analyze the Sample Forms [Study]
2+
3+
## Introduction
4+
5+
This Lab analyses your current Forms environment and identifies the important business logic. The first part of the Lab provides an overview guide on understanding forms modules and how they compare to APEX modules. The second part provides the sample forms used in this live lab.
6+
7+
*Note: This Lab assumes you have an Oracle Forms setup in your environment.*
8+
9+
Estimated Time: 5 Minutes
10+
11+
### Objectives
12+
13+
In this lab, you:
14+
15+
- Understand the current business logic in Oracle Forms and how to map it to Oracle APEX components.
16+
17+
## Task 1: Analyze Forms Business Logic
18+
19+
To modernize from Oracle Forms to APEX, you must understand the current business logic of your forms and where they are implemented. This is key for deciding how to adapt them to the APEX environment. The rule of thumb is always to push as much business logic as possible into the Oracle Database.
20+
21+
For example, the business logic in Oracle Forms resides in the triggers and program units. You can incorporate this logic into Oracle APEX as SQL or PL/SQL code that invokes database packages, procedures, or functions. The same applies to database objects, which do not need alteration when transitioning from Forms to APEX.
22+
23+
However, in Oracle Forms, business logic is also intertwined with user interface items such as go\_item, set\_item\_property, etc. In this case, separating and pushing logic to the database is impossible. In some cases, pushing the business logic of the triggers and program units into the database might be challenging.
24+
25+
Analyze and map the logic to the appropriate APEX component. The APEX environment natively handles multiple events and logic blocks through processes, computations, and validations. Understand how these components work and the customizations you can apply to them. This understanding prevents you from rewriting code and business logic that APEX's components can handle automatically.
26+
27+
You can add business logic to Forms through the PL/SQL attached libraries, which you can usually call from form modules. When mapping to APEX, add this logic as an application-level process that can be called from any application's pages. Additionally, you may find a plug-in to install that achieves the purpose of your business logic and extends your application's functionality. Plug-ins are available on:
28+
29+
- [apex.oracle.com](https://apex.oracle.com/en/solutions/apps/)
30+
- [apex.world](https://apex.world/ords/f?p=100:700)
31+
32+
Understanding how the mappings work on data blocks is also essential. In Forms, you can map data blocks into pages and page regions in APEX. There are different types of data blocks on Forms:
33+
34+
1. **Single Record Blocks**:
35+
In Forms, you may use a single record block for data queries and modifying returned records. In APEX, you generally map Oracle Forms blocks that are insertable, updatable, and have a primary key to an interactive report with a form or an editable Interactive Grid. The edit link on the interactive report allows access to a specific record for updating or deleting, and the interactive report lets you query the entries. An editable interactive grid lets you change several rows simultaneously without navigating to another form page.
36+
37+
2. **Tabular Forms**:
38+
Tabular Forms blocks in Forms map to an interactive grid in APEX, allowing you to edit each item later as needed (select list, text field, number field, etc.).
39+
40+
3. **Master Detail Blocks**:
41+
In Forms, master detail blocks highlight relationships between data blocks. In APEX, you can map this through the master detail region. The child region represents the "detail," and the parent region represents the "master," which can be a page region such as an interactive grid. Both regions connect through the foreign key relationship between the columns. You can define several child relationships deep and any number of child relationships wide.
42+
43+
4. **Non-Database Block**:
44+
Any block in Forms not associated with a database table or view is a non-database block. These blocks usually hold menus, lists, buttons, and other components. In APEX, we define these components based on their type. For example, the page designer defines buttons, while shared components define navigation menus.
45+
46+
## Task 2: Analyze Sample Forms
47+
48+
To put the previous guidelines into perspective, let's see how we can analyze the business logic and components of one of our sample forms. For this example, we will use the customer's form.
49+
50+
[Download the Sample Forms](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/labfiles/sample_forms.zip)
51+
52+
We start by reviewing the existing components in the form to analyze which can be migrated to APEX, which will be mapped to APEX components, and which will be removed or rewritten.
53+
54+
1. **Data Blocks**: Five data blocks, including **S\_CUSTOMER1** and **S\_CUSTOMER**, are associated with the **S\_CUSTOMER** table. The **S\_CUSTOMER** block is editable and allows CRUD operations, so you can map it into the Form item in APEX to enable the same operations. However, the **S\_CUSTOMER1** block isn't editable, so you can't handle it the same way.
55+
56+
The remaining three blocks **(CONTROL, NAV\_CONTROL, NAVIGATOR)** are non-database blocks that handle navigation in Forms and control the tree region, which isn't applicable in APEX.
57+
58+
![Blocks](images/data-blocks.png " ")
59+
60+
2. **Triggers**: The Customer's form contains multiple triggers, but we are now mainly focused on the triggers associated with the S\_CUSTOMER block.
61+
62+
The first trigger is **POST\_QUERY**. This trigger isn't translatable into APEX, as APEX automatically incorporates the trigger logic in the form's creation process. This is where the form items are initialized. Initialization options include initializing the form region items or retrieving data from the region source using the primary key value(s).
63+
64+
The second trigger is **WHEN-MOUSE-DOUBLECLICK**. This trigger executes the procedure EDIT\_TEXTITEM, which invokes a pop-up window editor for the COMMENTS column. When mapping to APEX, we can ignore this trigger since APEX will automatically initialize this COMMENTS column in the form.
65+
66+
3. **LOVs**: There is only one list of values created which is **SALES\_REP\_LOV** executing the above SQL statement.
67+
68+
![LOVs](images/lovs1.png " ")
69+
70+
![LOVs SQL Query](images/sql-query1.png " ")
71+
72+
In APEX, the LOV is created automatically with the form's creation. However, it may not display the intended values as in the SQL query.
73+
74+
To change this in **Oracle APEX**:
75+
76+
- Navigate to **App Builder** and select your application.
77+
78+
- Click **Shared Components**.
79+
80+
- Under **Other Components**, click **List of Values**.
81+
82+
- Click the list of values and update the name and SQL Query.
83+
84+
*Note: Remember that you can define additional display columns for item types that support multiple display columns.*
85+
86+
![LOVs SQL Query](images/sales-rep-lovs1.png " ")
87+
88+
4. **Alerts**: We have two alerts in the customer's form. The first alert, **DELETE\_ALERT**, is automatically created when the form is created in APEX, and you can customize the displayed message:
89+
90+
To customize the display message in Oracle APEX, follow the following steps:
91+
92+
- Navigate to **App Builder** and select your application.
93+
94+
- Click **Shared Components**.
95+
96+
- Under **Other Components**, click **Shortcuts**.
97+
98+
- Click **Create**.
99+
100+
- Create shortcut **From Scratch**.
101+
102+
- Click **Next**.
103+
104+
- For Name, enter **DELETE\_ALERT**.
105+
106+
- For Type, select **Text with JavaScript Escaped Single Quotes**.
107+
108+
- For a shortcut, enter the original message.
109+
110+
- Click **Create**.
111+
112+
You have created the message and need to update the shortcut in the APEX Form.
113+
114+
- Go to the **Customers** form page.
115+
116+
- In the left pane, click the page name.
117+
118+
- Navigate to property editor and update **Function and Global Variable Declaration** to var htmldb\_delete\_message='"DELETE\_ALERT"';
119+
120+
The second, **CONFIRM\_REVERT**, is handled natively by APEX through the warn on unsaved changes property, which can warn users when navigating away from the page with unsaved changes.
121+
122+
![Alerts](images/alerts1.png " ")
123+
124+
5. **Program Units**: The customer form contains seven program units. However, we cannot map them in our APEX app because either APEX handles them natively during form creation or they are not applicable.
125+
126+
![Program Units](images/program-units1.png " ")
127+
128+
## Summary
129+
130+
This Lab provides a comprehensive approach to understanding and migrating Oracle Forms components to Oracle APEX, ensuring a smooth modernization process by leveraging APEX's native capabilities and customization options.
131+
132+
## Acknowledgements
133+
134+
- **Author** - Monica Godoy, Senior Principal Product Manager ; Ankita Beri, Product Manager; Paolo Paolucci, Data Development Specialist; Victor Mendo, Data Development Specialist
135+
- **Last Updated By/Date** - Ankita Beri, Product Manager, July 2024
10.2 KB
Loading
45.2 KB
Loading
117 KB
Loading
20.2 KB
Loading
60.3 KB
Loading
27.1 KB
Loading
50.5 KB
Loading
23.3 KB
Loading
68.7 KB
Loading

0 commit comments

Comments
 (0)