Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Clic
k
help
for a
detai
led
TIP: expl Bookmark Go to End
anati
on
of
this
page
.
When you begin to update or delete a record on a DateTracked form, you are prompted
with a number of choices. This section describes the choices and their effect on the
DateTracked table.
The term "today" refers to the effective date set by the user.
Update
When a user first alters a field in a DateTracked block in the current Commit unit, he or
she sees a choice of Update prompts as follows:
o UPDATE - Updated values are written to the database as a new row,
effective from today until 31-DEC-4712. The old values remain effective
up to and including yesterday.
o CORRECTION - The updated values override the old record values and
inherit the same effective dates.
If the user selects UPDATE, DateTrack checks whether the record being updated starts
today. If it does, a message warns that the previous values will be lost (because
DateTrack can only store information on a day by day basis). DateTrack then changes the
mode for that record to CORRECTION.
Next, if UPDATE was selected, DateTrack checks whether the record being updated has
already had future updates entered. If it has been updated in the future, the user is further
prompted for the type of update, as follows:
In most forms, users are prompted for the update mode for each record they update. In
some forms, they are asked for the update mode for only the first record they update. Any
other rows updated take the same update mode. Users are not prompted again, until they
have committed or cleared any outstanding changes.
Delete
When deleting a record, the user is prompted for the type of delete. There are four
options, as follows:
o DELETE (End Date) - This is the DateTracked delete. The record that the
user is currently viewing has its effective end date set to today's date. The
record disappears from the form although the user can requery it.
o ZAP (Purge) - This is the total delete. All records matching the key value,
whatever their date stamps, are deleted.
o FUTURE CHANGE (All) - This choice causes any future dated changes
to the current record, including a future DateTracked delete, to be
removed. The current record has its effective end date set to 31-DEC-
4712.
Where another future dated DateTracked row exists for this record, it is
removed and the current row has its effective end date set to the effective
end date of the deleted row.
Where no future DateTracked row exists, but the current row has an end
date other than 31-DEC-4712, then this option causes the effective end
date to be set to 31-DEC-4712. This means that a date effective end is
considered to be a change.
Notice that this option again removes the current row from the form,
though it can be displayed again by requerying.
Insert
The user is not prompted for any modes when inserting a record. The effective start date
is always set to today (Effective Date). The effective end date is set as late as possible.
Usually this is 31-DEC-4712, although it can be earlier especially when the record has a
parent DateTracked record.
The effective start date indicates when the record was inserted. The effective end date
indicates when the record was deleted or updated. A deleted record has the highest end
date of all the rows with that key, but for an updated record there will be at least one row
for this key with a higher effective end date.
As time support is not provided, the effective start date commences at 0000 hours and the
effective end date finishes at 2359 hours. This means that a DT record can change at most
once per day.
Example
The table above shows the physical table after the user has done the following:
o Set the effective date to 12-MAR-1989. Inserted record for SMITH.
o Set the effective date to 20-JUL-1989. Updated SMITH record with new
salary.
o Set the effective date to 21-JUL-1989. Again updated SMITH record with
new salary.
The table below shows what the user sees on querying the SMITH record at different
effective dates.
EFFECTIVE DATE EMPID EMPNAME SALARY
Because the primary key column in the table is no longer unique, any indexes on the table
that included the primary key column must now also include the
EFFECTIVE_START_DATE and EFFECTIVE_END_DATE columns.
To get a list of the DateTracked tables used in Oracle Human Resources, select from the
data dictionary where the table name is like
Application Short Name%F. Substitute in the HRMS application short code you are
interested in (such as PER or BEN).
For each of the DateTracked tables there is a DateTracked view called <TABLE NAME>
and a synonym pointing to the full table called <TABLE NAME_F>.
In addition to the DateTracked view, there is another view that shows the rows in the
table as of SYSDATE. The name of this view is derived by replacing the _F at the end of
the table name by _X.
Example
Your custom code can restrict the buttons displayed. If necessary, it can require that the
user is given no update or delete options, and receives an error message instead.
However, it cannot display buttons that DateTrack would not normally display for the
entity, effective date, and operation the user is performing.
If the user chooses Update and future changes exist, the custom library event point may
be executed a second time so your custom code can determine whether the user is given
the two update options: Insert and Replace.
Global Variables
The following global variables can be used at the DT_SELECT_MODE event. They are
not available at any other CUSTOM library event.
Global Variable Name Read/Write Description
Attention: Custom code can change a TRUE value to FALSE. However, if it tries to
change a FALSE value to TRUE, the system ignores this change.
Enabling the DT_SELECT_MODE Event
To enable the DT_SELECT_MODE event, add the following code to the STYLE
procedure in the CUSTOM package, CUSTOM library:
if event_name = 'DT_SELECT_MODE' then
return custom.after;
else
return custom.standard;
end if;
Suppose you wanted to stop the Delete mode button from being displayed on the Mode
Selection window when DateTrack would normally make it available. You could add the
following code to the EVENT procedure in the CUSTOM package, CUSTOM library:
if (event_name = 'DT_SELECT_MODE') then
if name_in('GLOBAL.G_DT_DELETE') = 'TRUE' then
copy('FALSE', 'GLOBAL.G_DT_DELETE');
end if;
end if;