How to Get Current Row Number in a Grid or Scroll Area
How to Get Current Row Number in a Grid or Scroll Area by peoplecode function of PeopleSoft. The CurrentRowNumber function returns the current row on level one, or the parent row of the level two row where the PeopleCode program is executing.
Using function peopolecode is currentrownumber(scrolllevel);
This PeopleCode get value current row number in a grid or scroll by level.
if your grid or scroll area is @level 1 then use Currentrownumber(1) method spell.
if your grid or scroll area is @level 2 then use Currentrownumber(2) method spell.
For example 1. I have scrollarea level 1 on page and show row number of record in scroll area level 1 by peoplecode at below picture.
You define field number or character and replace peoplecode in rowinit event of this field.
DERIVED.SEQ.value = CurrentRowNumber(1);
——————————————————————————————————————–
Using Peoplecode for rearrange row equal rownum of grid area
Local Rowset &LEVEL0, &LEVEL1;
If %Page = Page.TS_TRF_JOB_DATA Then
Local Row &LEVEL0_ROW;
&LEVEL0 = GetLevel0();
&LEVEL0_ROW = &LEVEL0(1);
&LEVEL1 = &LEVEL0_ROW.GetRowset(Scroll.TS_TRF_JOBDATA);
For &i = 1 To &LEVEL1.ActiveRowCount
&LEVEL1_ROW = &LEVEL1(&i);
&LEVEL1(&i).TS_TRF_JOBDATA.SEQ.Value = &i;
End-For;
End-If;
References:
- https://it.toolbox.com/question/current-row-number-in-a-grid-081313
- https://docs.oracle.com/cd/E41509_01/pt852pbh2/eng/psbooks/tpcd/chapter.htm?File=tpcd/htm/tpcd05.htm%23g037ee99c9453fb39_ef90c_10c791ddc07__4b04