Home > PeopleCode > Three level Rowset Peoplecode

Three level Rowset Peoplecode

December 26, 2007 Leave a comment Go to comments

Here is a typical peoplecode example for reaching the level three reord using rowset peoplecode. 

/* Need to insert a row when a flag = ‘Y’ after graying all other fields in the row in correction mode */
PeopleCode Event : COMPONENT_NAME(Component).GBL.PostBuild(Component PeopleCode)

Local Rowset &TQ_Lvl0, &TQ_Lvl1, &TQ_Lvl2, &TQ_Lvl3;
Local number &insert_row, &lvl_1_row, &lvl_2_row, &lvl_3_row;

&TQ_Lvl0 = GetLevel0();
&TQ_Lvl1 = &TQ_Lvl0(1).GetRowset(Scroll.LEVEL1_SCROLL_NAME);
&insert_flag = “N”;

For &lvl_1_row = 1 To &TQ_Lvl1.ActiveRowCount
   &TQ_Lvl2 = &TQ_Lvl1(&lvl_1_row).GetRowset(Scroll.LEVEL2_SCROLL_NAME);
   For &lvl_2_row = 1 To &TQ_Lvl2.ActiveRowCount
      &TQ_Lvl3 = &TQ_Lvl2(&lvl_2_row).GetRowset(Scroll.LEVEL3_SCROLL_NAME);
      For &lvl_3_row = 1 To &TQ_Lvl3.ActiveRowCount
         &tq_adj_applied = &TQ_Lvl3(&lvl_3_row).LEVEL3_RECORD_NAME.FIELD_NAME.Value;
         If &tq_adj_applied = “Y” Then
            &TQ_Lvl3(&lvl_3_row).MPF_TINQ_LOG.EARNS_END_DT.Enabled = False;
            &TQ_Lvl3(&lvl_3_row).MPF_TINQ_LOG.MPF_ADD_SUBTRACT.Enabled = False;
            &TQ_Lvl3(&lvl_3_row).MPF_TINQ_LOG.MPF_HOURS_TYPE.Enabled = False;
            &TQ_Lvl3(&lvl_3_row).MPF_TINQ_LOG.MPF_HOURS_ADJ.Enabled = False;
            If %Mode = %Action_Correction Then
               &TQ_Lvl3.InsertRow(&TQ_Lvl3.ActiveRowCount);
            End-If;
         End-If;
      End-For
   End-For;
End-For;

About these ads
Categories: PeopleCode Tags:
  1. manasa
    May 16, 2008 at 8:22 am | #1

    i need how to make simple operations in level1 using rowset concept

  2. balaglobal
    May 16, 2008 at 2:08 pm | #2

    You mean your field is at level1 and you need to make simple operations for that field, then just do the first ‘for’ loop in the given example.

  3. krishnaraj
    May 23, 2008 at 12:54 am | #3

    what is function name convert char to number thru pcode.

  4. krishnaraj
    May 23, 2008 at 1:06 am | #4

    i m trying to Hide a column in level2,
    the correct is Invisiable, but the LABLE for filed still visiable????
    please HELP!!!!

  5. balaglobal
    May 27, 2008 at 5:53 pm | #5

    Krishnaraj,
    For your first question, use “value” function to convert a char to number.

    Ex:
    &stringnum = “1234.56″
    &val = value(&stringnum)

    Regarding your second question, use field class property label and method “enabled”.
    Ex:
    field.label.enabled

    Bala.

  6. krishnaraj
    May 29, 2008 at 12:44 am | #6

    i need to change a derived fld value for secondary page in level 2

    i m not able to access this fld values.
    i tried….
    &fld = getlevel0()(1).reclevel1(1).reclevel2(1).derv.field.value;
    above syntax is not working…..

    please advice…!!!!

  7. reddeppa
    August 23, 2008 at 9:57 am | #7

    how to activate seconday page using peoplecode comand can u give some code

  8. sarat
    April 22, 2009 at 8:47 am | #8

    using domodal

  9. sanmitra
    June 1, 2011 at 6:34 pm | #9

    ..

  1. November 7, 2008 at 8:37 am | #1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 37 other followers

%d bloggers like this: