Hello people! It’s been quite a while since I posted. I’ve had a very interesting requirement to work on. There could be easier ways to do this, but here goes:
1. There are 4 pages in a custom component – Page 1,2,3 and 4
2. On page 4, there are 3 levels – Level 0, 1 and 2
3. Level 0 and 1 point to the same record – Header – Level 1 is a scroll
4. Level 2 points to a child record – Process – Level 2 is a scroll
And, here’s the interesting part:
a. When I add a new row in Level 1, it should mirror the existing delivered PeopleSoft functionality – adding a new effective dated row copies values from the previous effective dated row
b. When I add a new row in Level 2 – it should copy over values that have been provided from the same effective dated row from Page 1.
So, the catch here is that, if you add rows in Level 1, it would also trigger RowInsert in level 2. So, we would need to find a way to let the PeopleCode know which Record’s RowInsert is being triggered. I don’t know if there is any delivered function to let the PeopleCode know the calling event’s record. Instead, this is what I did.
Level 1 RowInsert PeopleCode
Component number &count; Component string &HeaderInsert; &count = 1; &HeaderInsert = "Y";
Reset the Header flag to N , when the control reaches the last row in Level 2’s rowset
Level 2 RowInsert PeopleCode
if &HeaderInsert <> "Y" then call level 2 PeopleCode; end-if; if &count = Level2RowSet.ActiveRowcount and &HeaderInsert ="Y" then &HeaderInsert = "N"; &count=0; end-if; &count = &count + 1;
Hope this helps! Please drop a comment if you need more details. 🙂