Working With Effective-Dated Data

When you work with effective-dated data, use some combination of the following methods:

  • CurrentItem

  • GetEffectiveItem

Both these methods return an item, however, there are some differences:

  • The CurrentItem method takes no parameters, so it bases the item it returns on the current system date.

  • The GetEffectiveItem method bases the item it returns on a user-provided date. They all perform the same logic, they just use a different date.

Note: To show all history for an effective-dated collection, you must set GetHistoryItems to True before you populate the Component Interface.

If a user is making an update to an effective-dated record, they don’t always want to insert a row at the end.

Suppose the database contained the following data:

EMPLID

EFFDT

SEQNO

8000

3/1/99

0

8000

7/1/99

0

8000

9/1/99

0

8000

12/1/99

0

Now suppose the user wants to enter info with EFFDT of 11/1/99. If they were looking at a PeopleSoft component, they would visually scan to see where that date falls and then press ALT+7 and ENTER at the row that they want to insert after.

GetEffectiveItem enables you to pass in the correct effective date, instead of having to loop through every item in the collection doing a comparison, looking for the correct item.

Why Can't it Just Go at the End?

The InsertItem method simulates pressing ALT+7 and ENTER online to insert a row in a scroll. Part of the logic that occurs in the Component Processor is that if the scroll is effective-dated, the ALT+7 and ENTER carries the values forward from the previous row. This functionality is still there if you use InsertItem at the end of the collection, but the values may be incorrect.