Main Index
PREV
NEXT
|
These are called multi-purpose forms because they allow several functions (e.g. SELECT, LIST, ADD, MODIFY and DELETE) to be performed in a single component rather than having a separate component for each function.
There are several reasons why this type of component may be chosen:-
This type of form is for those entities where the number of fields is so small that each occurrence can be displayed on a single line. Two fields are shown in this example, but there may be more.
Upon initial entry the form will perform an automatic retrieve of all available entries, therefore may not be suitable for a table with large volumes of data.
The user makes whatever modifications are required, then preses the OK button to update the database, terminate and return control to the previous form.
OK | Will commit all changes to the database (provided that all validation is successful), then exit and return control to the parent form. |
CANCEL | Will abandon all outstanding changes and return control immediately to the parent form. |
ADD | Will present the user with an empty occurrence so that a new entry may be input. The database will not be updated until the OK button is pressed. |
DELETE | Will delete the current occurrence from the screen, provided that no subordinate entries exist. The database will not be updated until the OK button is pressed. |
Source Entity | Source Field | Target Entity | Target Field |
---|---|---|---|
ACTION_BAR.INF | CANCEL | ACTION_BAR.INF | CANCEL |
OK | OK | ||
ADD | ADD | ||
DELETE | DELETE | ||
COLUMN_BAR.INF | FIRST | ||
LAST | |||
MAIN | FIRST | ||
LAST |
Name | Expression | Description |
---|---|---|
FORM_VERSION | 01.000.000 | To be incremented each time the component is changed. |
VERIFY_DELETE | Signifies what validation needs to be done if the DELETE ley is pressed:
|
Name | Description |
---|---|
FORM_VERSION | |
READ_COUNT |
This type of form is for those occasions where the contents of each occurrence is too large to fit into a single line, therefore the screen can only show one occurrence at a time.
Upon initial entry the form will perform an automatic retrieve of all available entries, therefore may not be suitable for a table with large volumes of data.
The user makes whatever modifications are required, then preses the OK button to update the database, terminate and return control to the previous form.
OK | Will commit all changes to the database (provided that all validation is successful), then exit and return control to the parent form. |
CANCEL | Will abandon all outstanding changes and return control immediately to the parent form. |
ADD | Will present the user with an empty occurrence so that a new entry may be input. The database will not be updated until the OK button is pressed. |
DELETE | Will delete the current occurrence from the screen, provided that no subordinate entries exist. The database will not be updated until the OK button is pressed. |
Source Entity | Source Field | Target Entity | Target Field |
---|---|---|---|
ACTION_BAR.INF | CANCEL | ACTION_BAR.INF | CANCEL |
OK | OK | ||
ADD | ADD | ||
DELETE | DELETE | ||
MAIN | FIRST | ||
LAST |
Name | Expression | Description |
---|---|---|
FORM_VERSION | 01.000.000 | To be incremented each time the component is changed. |
VERIFY_DELETE | Signifies what validation needs to be done if the DELETE ley is pressed:
|
Name | Description |
---|---|
FORM_VERSION | |
INIT_VALUES | |
PARAMS | |
READ_COUNT |
This type of form is used in a ONE-to-MANY relationship in order to maintain the occurrences of the MANY entity for a selected occurrence of the ONE entity.
Upon initial entry the form will retrieve an occurrence of the ONE entity using the primary key passed down by the parent form, then retrieve all associated occurrences of the MANY entity.
OK | Will commit all changes to the database (provided that all validation is successful), then exit and return control to the parent form. |
CANCEL | Will abandon all outstanding changes and return control immediately to the parent form. |
ADD | Will present the user with an empty occurrence of MANY so that a new entry may be input. The database will not be updated until the OK button is pressed. |
DELETE | Will delete the current occurrence of MANY from the screen, provided that no subordinate entries exist. The database will not be updated until the OK button is pressed. |
Source Entity | Source Field | Target Entity | Target Field |
---|---|---|---|
ACTION_BAR.INF | CANCEL | ACTION_BAR.INF | CANCEL |
OK | OK | ||
ADD | ADD | ||
DELETE | DELETE | ||
COLUMN_BAR.INF | FIRST | ||
LAST | |||
ONE | FIRST | ||
MANY | FIRST | ||
LAST |
Name | Expression | Description |
---|---|---|
FORM_VERSION | 01.000.000 | To be incremented each time the component is changed. |
VERIFY_DELETE | Signifies what validation needs to be done if the DELETE ley is pressed:
|
Name | Description |
---|---|
FORM_VERSION | |
INIT_VALUES | |
PARAMS | |
READ_COUNT |
This type of form is used to maintain the details of what is sometimes referred to as a MANY-to-MANY relationship. This can only be supported with the introduction of linking (cross-reference) entity which then produces a pair of ONE-to-MANY relationships, as shown in Figure 1.
Figure 1 - A typical ONE-to-MANY-to-ONE relationship
The primary key of the MANY entity is actually a combination of the primary keys from ONE A and ONE B. This means that only one occurrence of XREF can exist for a combination of primary key A and primary key B.
In this type of form the structure of the entities is as shown in Figure 2.
Figure 2 - Structure of the Multi 4 template
Only occurrences of MANY can be modified - both OUTER and INNER are read-only.
Note that no fields from entity MANY are displayed as it contains nothing but foreign key fields whose values are obtained from the two related entities.
This function will probably need two versions:-
Upon initial entry this function will perform an automatic retrieve of entity OUTER using the primary key passed down from the parent form. It will then retrieve all associated occurrences of MANY followed by an occurrence of INNER using the foreign key on MANY.
OK | Will commit all updates to the database and return to the parent form. | ||||
CANCEL | Will abandon all outstanding updates and return to the parent form. | ||||
ADD | Will create a new occurrence of the MANY entity, with an empty INNER entity, and do one of the following, depending on the setting in local constant <AUTO_POPUP>:-
If an occurrence of INNER is selected which already has a link on MANY with the current OUTER it will be discarded with a DUPLICATE PRIMARY KEY message. The database will not be updated until the OK button is pressed. |
||||
DELETE | Will delete the current (highlighted) occurrence of the MANY entity from the screen. The database will not be updated until the OK button is pressed. |
Source Entity | Source Field | Target Entity | Target Field |
---|---|---|---|
ACTION_BAR.INF | CANCEL | ACTION_BAR.INF | CANCEL |
OK | OK | ||
ADD | ADD | ||
DELETE | DELETE | ||
COLUMN_BAR.INF | FIRST | ||
LAST | |||
ONE | FIRST | ||
MANY | FIRST | ||
LAST |
Name | Expression | Description |
---|---|---|
FORM_VERSION | 01.000.000 | To be incremented each time the component is changed. |
AUTO_POPUP | Refer to the ADD button. |
Name | Description |
---|---|
FORM_VERSION | |
PARAMS | |
READ_COUNT |
This type of form is similar to MULTI 4, but retrieves occurrences of entity INNER before those of entity MANY. The component structure is shown in Figure 3.
Figure 3 - Structure of the Multi 4a template
Upon initial entry this function will perform an automatic retrieve of entity OUTER using the primary key passed down from the parent form. It will then retrieve all available occurrences of INNER, then perform a lookup on MANY in determine the starting value of the SWITCH checkbox:-
Entries on entity MANY can be deleted by turning SWITCH from ON to OFF, or created by turning SWITCH from OFF to ON. This can be done either by clicking on the SWITCH checkbox or by double clicking on any other field within the line. This provides a very fast method of creating or deleting the link between ONE A and ONE B.
As this type of component retrieves all available occurrences of the INNER entity it may not be wise to use it if this table contains a large volume of occurrences. Consider using template MULTI 4b instead. |
OK | Will commit all pending updates to the database and return to the parent form. |
CANCEL | Will abandon all outstanding updates and return to the parent form. |
STORE | Will commit all pending updates to the database, but will remain within this function. |
Source Entity | Source Field | Target Entity | Target Field |
---|---|---|---|
ACTION_BAR.INF | CANCEL | ACTION_BAR.INF | CANCEL |
OK | OK | ||
STORE | STORE | ||
COLUMN_BAR.INF | FIRST | ||
LAST | |||
OUTER | FIRST | ||
INNER | FIRST | ||
LAST | |||
SWITCH |
Name | Expression | Description |
---|---|---|
FORM_VERSION | 01.000.000 | To be incremented each time the component is changed. |
FKEY_OUTER | The name of the foreign key field on MANY which links to OUTER. | |
PKEY_OUTER | The name of the primary key field on OUTER. |
Name | Description |
---|---|
FORM_VERSION | |
PARAMS | |
READ_COUNT |
This type of function is similar to MULTI 4a, but in cases where there can potentially be a large number of occurrences of entity INNER it may be useful to offer the facility of processing the data in subsets by using the profile area.
Upon initial entry this form will perform an automatic retrieve using a profile with ACCESS SWITCH set to ON so that only those occurrences of INNER where there is a linking entry on MANY will be displayed.
The ACCESS switch in the profile area is a tri-state checkbox:-
|
Entries on entity MANY can be deleted by turning ACCESS from ON to OFF, or created by turning ACCESS from OFF to ON. This can be done either by clicking on the ACCESS checkbox or by double clicking on any other field within the line.
OK | Will commit all pending updates to the database and return to the parent form. |
CANCEL | Will abandon all outstanding updates and return to the parent form. |
STORE | Will commit all pending updates to the database, but will remain within this function. |
CLEAR | Will clear the form of all data and place the cursor in the profile area. |
RETRIEVE | Will retrieve data according to the selection criteria in the profile area. |
Source Entity | Source Field | Target Entity | Target Field |
---|---|---|---|
ACTION_BAR.INF | CANCEL | ACTION_BAR.INF | CANCEL |
OK | OK | ||
STORE | STORE | ||
CLEAR | CLEAR | ||
RETRIEVE | RETRIEVE | ||
COLUMN_BAR.INF | FIRST | ||
LAST | |||
OUTER | FIRST | ||
INNER | FIRST | ||
LAST | |||
ACCESS | |||
RETRIEVE_PROFILE | FIRST | ||
LAST | |||
ACCESS |
Name | Expression | Description |
---|---|---|
FORM_VERSION | 01.000.000 | To be incremented each time the component is changed. |
FKEY_OUTER | The name of the foreign key field on MANY which links to OUTER. | |
PKEY_OUTER | The name of the primary key field on OUTER. |
Name | Description |
---|---|
FORM_VERSION | |
PARAMS | |
READ_COUNT |
This is the same as MULTI 4, but with the addition of a navigation bar.
Upon initial entry this function will perform an automatic retrieve of entity OUTER using the primary key passed down from the parent form. It will then retrieve all associated occurrences of MANY followed by an occurrence of INNER using the foreign key on MANY.
OK | Will commit all updates to the database and return to the parent form. | ||||
CANCEL | Will abandon all outstanding updates and return to the parent form. | ||||
ADD | Will create a new occurrence of the MANY entity, with an empty INNER entity, and do one of the following, depending on the setting in local constant <AUTO_POPUP>:-
If an occurrence of INNER is selected which already has a link on MANY with the current OUTER it will be discarded with a DUPLICATE PRIMARY KEY message. The database will not be updated until the OK button is pressed. |
||||
DELETE | Will delete the current (highlighted) occurrence of the MANY entity from the screen. The database will not be updated until the OK button is pressed. |
Source Entity | Source Field | Target Entity | Target Field |
---|---|---|---|
ACTION_BAR.INF | CANCEL | ACTION_BAR.INF | CANCEL |
OK | OK | ||
ADD | ADD | ||
DELETE | DELETE | ||
COLUMN_BAR.INF | FIRST | ||
LAST | |||
ONE | FIRST | ||
MANY | FIRST | ||
LAST | |||
NAVIGATION_BAR | FIRST | ||
LAST |
Name | Expression | Description |
---|---|---|
FORM_VERSION | 01.000.000 | To be incremented each time the component is changed. |
AUTO_POPUP | Refer to the ADD button. |
Name | Description |
---|---|
FORM_VERSION | |
PARAMS | |
READ_COUNT |
This type of function is similar to MULTI 4, but caters for a more complex form of linking (XREF) entity, as shown in Figure 4.
Figure 4 - ONE(a)-to-MANY-to-ONE(b), with dynamic list for ONE(b)
In this structure each occurrence of ONE B has its own set of occurrences on LIST B which identify those items where access can be switched ON or OFF (allowed or disallowed). Each occurrence of MANY (XREF) contains an indexed list of those items where the ACCESS ALLOWED switch has be changed from its initial setting.
The structure of this type of component is shown in Figure 5.
Figure 5 - Structure of the Multi 5 template
When the database is updated the indexed list on each occurrence of MANY is rebuilt to contain only those items from LIST (B) where the ACCESS ALLOWED switch has be changed from local constant <INITIAL_SETTING>. If the list is empty then the occurrence of MANY is deleted.
Local constant <INITIAL_SETTING> can be set at compile time to one of the following values:-
OK | Will commit all updates to the database and return to the parent form. | ||||
CANCEL | Will abandon all outstanding updates and return to the parent form. | ||||
ADD | Will create a new occurrence of the MANY entity, with an empty INNER entity, and do one of the following, depending on the setting in local constant <AUTO_POPUP>:-
If an occurrence of INNER is selected which already has a link on MANY with the current OUTER it will be discarded with a DUPLICATE PRIMARY KEY message. All data from LIST will be shown with each ALLOWED switch set to the value of local constant <INITIAL_SETTING>. The database will not be updated until the OK button is pressed. |
||||
DELETE | Will remove the current occurrence of MANY and its associated INNER from the screen. The database will not be updated until the OK button is pressed. | ||||
STORE | Will commit all updates to the database but remain in the form. |
Source Entity | Source Field | Target Entity | Target Field |
---|---|---|---|
ACTION_BAR.INF | CANCEL | ACTION_BAR.INF | CANCEL |
OK | OK | ||
ADD | ADD | ||
DELETE | DELETE | ||
STORE | STORE | ||
COLUMN_BAR.INF | FIRST | ||
LAST | |||
OUTER | FIRST | ||
MANY | N/A | N/A | |
INNER | FIRST | ||
LIST | ALLOWED | ||
LIST_ITEM |
Name | Expression | Description |
---|---|---|
FORM_VERSION | 01.000.000 | To be incremented each time the component is changed. |
INITIAL_SETTING | 0 or 1 | The initial setting for the ALLOWED checkbox. 0 = OFF, 1 = ON. |
AUTO_POPUP | Refer to the ADD button. |
Name | Description |
---|---|
FORM_VERSION | |
PARAMS | |
READ_COUNT |
This type of form is similar to MULTI 5, but caters for the situation where ONE B has to be the outer entity instead of ONE A.
The structure of this type of component is shown in Figure 6. You will notice that entity LIST is now inside entity OUTER instead of entity INNER. A dummy entity is placed inside INNER to hold the ACCESS ALLOWED switch and the LIST ITEM field.
Figure 6 - Structure of the Multi 5a template
OK | Will commit all updates to the database and return to the parent form. | ||||
CANCEL | Will abandon all outstanding updates and return to the parent form. | ||||
ADD | Will create a new occurrence of the MANY entity, with an empty INNER entity, and do one of the following, depending on the setting in local constant <AUTO_POPUP>:-
If an occurrence of INNER is selected which already has a link on MANY with the current OUTER it will be discarded with a DUPLICATE PRIMARY KEY message. All data from LIST will be shown with each ALLOWED switch set to the value of local constant <INITIAL_SETTING>. The database will not be updated until the OK button is pressed. |
||||
DELETE | Will remove the current occurrence of MANY and its associated INNER from the screen. The database will not be updated until the OK button is pressed. | ||||
STORE | Will commit all updates to the database but remain in the form. |
Source Entity | Source Field | Target Entity | Target Field |
---|---|---|---|
ACTION_BAR.INF | CANCEL | ACTION_BAR.INF | CANCEL |
OK | OK | ||
ADD | ADD | ||
DELETE | DELETE | ||
STORE | STORE | ||
COLUMN_BAR.INF | FIRST | ||
LAST | |||
OUTER | FIRST | ||
MANY | N/A | N/A | |
INNER | FIRST | ||
LIST | LIST_ITEM | ||
DUMMY | ALLOWED | ||
LIST_ITEM |
Name | Expression | Description |
---|---|---|
FORM_VERSION | 01.000.000 | To be incremented each time the component is changed. |
INITIAL_SETTING | 0 or 1 | The initial setting for the ALLOWED checkbox. 0 = OFF, 1 = ON. |
AUTO_POPUP | Refer to the ADD button. |
Name | Description |
---|---|
FORM_VERSION | |
PARAMS | |
READ_COUNT |
http://www.tonymarston.net |