Ppl Code Events

Embed Size (px)

Citation preview

  • 8/18/2019 Ppl Code Events

    1/5

    INTERVIEW PREPARATION 

    PeopleCode Events

    1.Page Activate

    Page activate is on whole page ,not on all the rows/recs

    WHAT U CAN D

    !hide/"nhide #ields/scroll!chec$ the sec"rit% #or the "ser who is accessing the page

    &A'(D )*

    This event is valid only for pages that are defined as standard or secondary. This event isnot supported for subpages.

    +.)iledChange

    Use FieldChange PeopleCode to recalculate page field values, change the appearance of

    page controls, or perform other processing that results from a field change other than data

    validation

    3.FieldDefault

    • The page field is still blank after applying any default value specified in the record

    field properties.

    This is true if there is no default specified, if a null value is specified, or if a is

    specified for a numeric field.

    • The field has a FieldDefault PeopleCode program.

    !.Field"dit "vent

    Use Field"dit PeopleCode to validate the contents of a field, supplementing standard

    system edits. #f the data does not pass the validation, the PeopleCode program should

    display a message using the "rror statement, $hich redisplays the page, displaying an error

    message and turning the field red

    %.FieldFormula "vent

  • 8/18/2019 Ppl Code Events

    2/5

    Only on fields now in libs

    &.#tem'elected "vent

    The #tem'elected event is initiated $henever a user selects a menu item from a pop(up

    menu. #n pop(up menus, #tem'elected PeopleCode e)ecutes in the conte)t of the page fieldfrom $here the pop(up menu is attached, $hich means that you can freely reference and

    change page fields, *ust as you could from a button.

    +.Postuild "vent

    The Postuild event is initiated after all the other component build events have been

    initiated. This event is often used to hide or unhide pages. #t-s also used to set component

    variables.

    Postuild PeopleCode is only associated $ith components.

    .Preuild "vent

    The Preuild event is initiated before the rest of the component build events. This event is

    often used to hide or unhide pages. #t-s also used to set component variables.

    /ote. If a PreBuild PeopleCode program issues an error or warning, the user is returned to the

    search page. If the search record has no keys, a blank component page appears.

    0lso use the Preuild event to validate data entered in a search page after a prompt list is

    displayed. For e)ample, after a user selects key values on a search, the Preuild

    PeopleCode program runs, catches the error condition, and issues an error message. The

    user receives and ackno$ledges the error message. The component is canceled 1because of

    the error2, and the user is returned to the search page. Preuild PeopleCode is only

    associated $ith components.

    .PrePopup "vent

    The PrePopup event is initiated *ust before the display of a pop(up menu.

    4ou can use PrePopup PeopleCode to control the appearance of the pop(up menu.

    /ote. This event, and all its associated PeopleCode, does not initiate if run from a

    component interface.

    PrePopup PeopleCode can be associated $ith record fields and component record fields.

    5.6o$Delete "vent

    The 6o$Delete event is initiated $henever a user attempts to delete a ro$ of data from a

    page scroll area. Use 6o$Delete PeopleCode to prevent the deletion of a ro$ 1using an

    "rror or 7arning statement2 or to perform any other processing contingent on ro$

    deletion. For e)ample, you could have a page field called Total on scroll area level 8ero

    $hose value is the sum of all the ")tension page fields on scroll area level one. #f the user

    deleted a ro$ on scroll area level one, you could use 6o$Delete PeopleCode to recalculate

    the value of the Total field.

  • 8/18/2019 Ppl Code Events

    3/5

    55.697#nit "vent

    The 6o$#nit event is initiated the first time that the Component Processor encounters a

    ro$ of data. #Use it to set the initial state of component controls. This occurs during

    component build processing and ro$ insert processing. #t also occurs after a 'elect or

    'elect0ll 6o$set method, or a 'croll'elect or related function, is e)ecuted.

    /o initiali8ations : b done here.

    5:.6o$#nsert "vent

    7hen a user adds a ro$ of data, the Component Processor generates a 6o$#nsert event.

    4ou should use 6o$#nsert PeopleCode for processing specific to the insertion of ne$ ro$s.

    Do not put PeopleCode in 6o$#nsert that already e)ists in 6o$#nit, because a 6o$#nit

    event al$ays initiates after the 6o$#nsert event, $hich $ill cause your code to be run t$ice.

    53.6o$'elect "vent

    The 6o$'elect event is initiated at the beginning of the component build process in any of

    the update action modes 1Update, Update;Display 0ll, Correction2. 6o$'elect PeopleCode

    is used to filter out ro$s of data as they are being read into the component buffer. Thisevent also occurs after a 'croll'elect or related function is e)ecuted

    5!.'ave"dit "vent

    The 'ave"dit event is intiated $henever a user attempts to save the component. 4ou can

    use 'ave"dit PeopleCode to validate the consistency of data in component fields. 7henever

    a validation involves more than one component field, you should use 'ave"dit PeopleCode.

    #f a validation involves only one page field, use Field"dit PeopleCode.

    'ave"dit is not field(specific< it triggers associated PeopleCode on every ro$ of data in the

    component buffers, e)cept ro$s flagged as deleted.

    0n "rror statement in 'ave"dit PeopleCode displays a message and redisplays the

    component $ithout saving data. 0 7arning statement enables the user to click 9= andsave the data, or to click Cancel and return to the component $ithout saving.

    Use the 'etCursorPos function to set the cursor position to a specific page field follo$ing a

    $arning or error in 'ave"dit, to sho$ the user the field 1or at least one of the fields2 that is

    causing the problem. >ake sure to call 'etCursorPos before the error or $arning, because

    these may terminate the PeopleCode program.

    'ave"dit PeopleCode can be associated $ith record fields and components.

    5%.'avePostChange "vent

    0fter the Component Processor updates the database, it initiates the 'avePostChange

    event. 4ou can use 'avePostChange PeopleCode to update tables not in your componentusing the '?@")ec built(in function.

    0n error or $arning in 'avePostChange PeopleCode causes a runtime error. 0void errors

    and $arnings in this event.

    The system issues a '?@ Commit statement after 'avePostChange PeopleCode completes

    successfully.

    #f you are e)ecuting 7orkflo$ PeopleCode, keep in mind that if the 7orkflo$ PeopleCode

  • 8/18/2019 Ppl Code Events

    4/5

  • 8/18/2019 Ppl Code Events

    5/5

    been provided, or by skipping it if possible, $ith the 'et'eachDialogehavior function. 4ou

    can also force search processing to al$ays occur by selecting the Force 'earch Processing

    check bo) in the component properties in People'oft 0pplication Designer.

     SearchInit PeopleCode Function Restrictions

    You can't use the following functions in SearchInit PeopleCode:

    •  Doodal 

    •  DoodalCo!ponent 

    • "ransfer 

    • "ransferPage

    5.'earch'ave "vent

    'earch'ave PeopleCode is e)ecuted for all search key fields on a search, add, or data(entrydialog bo) after a user clicks 'earch. This enables you to control processing after search

    key values are entered, but before the search based on these keys is e)ecuted. 0 typical use

    of this feature is to provide cross(field edits for selecting a minimum set of key information.

    This event is also used to force a user to enter a value in at least one field, even if it-s a

    partial value, to help narro$ a search for tables $ith many ro$s.

    /ote. 'earch'ave is not initiated $hen values are selected from the search list. To validate

    data entered in the search page, use the Component Preuild event.

    4ou can use "rror and 7arning statements in 'earch'ave PeopleCode to send the user

    back to the search page if the user entry does not pass validations implemented in the

    PeopleCode.

    /ote. This event, and all its associated PeopleCode, is not initiated if run from a component

    interface.

    'earch'ave PeopleCode can be associated $ith record fields and component search

    records.