Monday, May 24, 2010

Row Traversing

&LEVEL0 = GetLevel0();                                               --level zero rowset
&LEVEL0_ROW = &LEVEL0(1);                                            --Level Zero Row
&LEVEL1 = &LEVEL0_ROW.GetRowset(SCROLL.EMPL_CHECKLIST);              --level1 Rowset


For &I = 1 to &LEVEL1.ActiveRowCount --for loop to get all the values till current row
   &LEVEL1_ROW = &LEVEL1(&I);
   &LEVEL2 = &LEVEL1_ROW.GetRowset(SCROLL.EMPL_CHKLST_ITM);
   For &J = 1 to &LEVEL2.ActiveRowCount
        &LEVEL2_ROW = &LEVEL2(&J);
        &LEVEL3 = &LEVEL2_ROW.GetRowset(SCROLL.EMPL_CHKLST_ITM_1);
        For &k = 1 to &LEVEL3.ActiveRowCount
                &LEVEL3_ROW = &LEVEL3(&k);
               &RECORD = &LEVEL3_ROW.EMPL_CHKLST_ITM_1;              --get record
               &Emplid = &RECORD.emplid.value;                       --get value
               Winmessage(“Employee ID: “|&Emplid);                  --to display all retrieved employee IDs online
        End-For;
   End-For;
End-For;

In this case for suppose we have 1 row in EMPL_CHECKLIST, 5 rows in EMPL_CHKLST_ITM, 10 rows in EMPL_CHKLST_ITM_1 for the same employee ID, then we will get 10 messages when the system executes given code.


Some more Row Traversing functions:

CurrentRowNumber(1);

Thursday, May 13, 2010

Issue: Not Able to create an employee with Employee Record '0'

Issue: Some times in Peoplesoft system we can not create a new employee with Employee Record zero. In 'Organizational Relationships' page 'Empl Rcd' will be defaulted to '1'. Even if we try to overwrite it with '0' it will through the error: 'This Empl_rcd is already in use for this person in PER_ORG_ASGN. Choose a diffrent EMPL_RCD.' as in the following screen shot.
This happens because there is a row in database with Employee ID :'NEW'. Peoplsoft system shoould not allow to create an Employee with Empl ID 'NEW', because of some descripancies in the system Empl ID 'NEW' will be created.
Even in the same instance this issue can not be replicated. We can not use 'ID Delete' component to delete this Empl ID, because we can not get emplid in prompt table.

We can not find Empl ID 'NEW' in ID Dlelete Component. It is because Empl ID 'NEW' is not there in 'PERS_SRCH_ALL' View and Undelying Tables.

Resolution: Insert dummy row with Empl ID with 'NEW' into all the underlying records of the View 'PERS_SRCH_ALL' which are 'PS_PERSON', 'PS_PERS_DATA_EFFDT' and 'PS_NAMES'. Then proceed to run ID Delete process with emplid 'NEW'.