How a Developer Uses GetEffectiveItem

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.