How to Travel through all the records and fields all levels in a component

Travel through all the records and fields all levels in a component This is a typical peoplecode example for traverse through all the records and fields in a component This might be handy when you want to troubleshoot. 
/* Get the parent Level 0 rowset */ Local Rowset &Parent = GetLevel0(); Local number &I, &J, &K, &L; Local Rowset &RS; Local Row &RowChild; Local Record &Rec; For &II = 1 To &Parent.ActiveRowCount /* To get the number of child rowsets of the row */ For &I = 1 To &Parent(&II).ChildCount /* Get each rowset*/ &RS = &Parent(&II).GetRowset(&I); /* For each rowset each ActiveRowCount */ For &J = 1 To &RS.ActiveRowCount /* Get the each row for each rowset */ &RowChild = &RS.GetRow(&J); /* For each row, how many records */ For &K = 1 To &RowChild.RecordCount &Rec = &RowChild.GetRecord(&K); /* show each Record Name */ WinMessage(&Rec.Name, 0); /* if record has changed show a message */ If &Rec.IsChanged Then WinMessage("this record is changed " | &Rec.Name, 0); /* Go through fields */ For &M = 1 To &Rec.FieldCount If &Rec.GetField(&M).IsChanged Then /* If field has changed show a message */ WinMessage("this field is changed " |  
&Rec.GetField(&M).Name | " value " | &Rec.GetField(&M).Value, 0); End-If; End-For; Else WinMessage("this record is not changed " | &Rec.Name, 0); End-If; End-For; End-For; End-For; End-For;
SHARE

Ayesha Wee

    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment