• Understanding Peoplecode – RowInit and Page Activate Events

    Posted on September 26, 2012 by in Other Programming, People Soft

    RowInit

    The RowInit event is initiated the first time that the Component Processor encounters a row of data. This occurs during component build processing and row insert processing. It also occurs after a Select or SelectAll Rowset method, or a ScrollSelect or related function, is executed.

    Code Example in RowInit

    If %Page = Page.PAGE_NAME Then
          RECORD_WRK.CALC_FIELD = RECORD1.FIELD1 * RECORD2.FIELD2;
    End-If;
    

    Important things to Note

    • Do not use Error or Warning statements in RowInit PeopleCode, these cause a runtime error.
    • RowInit is often written together with FieldChange event.
      In the above example, the value of RECORD_WRK.CALC_FIELD is shown as the product of RECORD1.FIELD1 and RECORD1.FIELD2. Generally, similar code is written in FIELDCHANGE event of RECORD1.FIELD1 and RECORD1.FIELD2 so that value of RECORD_WRK.CALC_FIELD is updated whenever the field value changes.
    • RowInit is not field-specific.
      That is, It triggers PeopleCode on all fields and on all rows in the component buffer. In the above example, the above code can be written in ROWINIT of either of FIELD1 or FIELD2 not both. Although you can write code like this in PAGE ACTIVATE which we will discuss later.
    • RowInit PeopleCode can be associated with record fields and component records.

    Activate Event

    The Activate event is initiated each time that a page is activated, including when a page is first displayed by a user, or if a user presses Tab between different pages in a component.

    Important things to Note

    • Every Page has it’s own Activate Event
    • This event is not supported for subpages.
    • Effectively eliminates need to write Page Specific RowInit code. For Example, If Page1, hide some field, Page Hide other field etc.
    • This event is valid only for pages that are defined as standard or secondary.
    Be Sociable, Share!
      Post Tagged with ,

    Written by

    Vanamali Juvvadi is a Web enthusiast and loves all things design and technology. Founded qnownow with a group of friends to share anything/everything they know/find on the internet.

    View all articles by

    Email : [email protected]

    Leave a Reply