Вы находитесь на странице: 1из 17

PeopleCode Events

PeopleCode Events
o o o o o o o o o o o o o o o o o o o o o

1).Activate Event 2).FieldChange Event 3).FieldDefault Event 4).FieldEdit Event 5).FieldFormula Event 6).ItemSelected Event 7).PostBuild Event 8).PreBuild Event 9).PrePopup Event 10).PSControlInit Event 11).PSLostFocus Event 12).RowDelete Event 13).RowInit Event 14).RowInsert Event 15).RowSelect Event 16).SaveEdit Event 17).SavePostChange Event 18).SavePreChange Event 19).SearchInit Event 20).SearchSave Event 21).Workflow Event

PeopleCode Events


Activate Event This is fired every time the page is activated.,means when the page is first brought up by the end-user, or if a end-user tabs between different pages in a component. Every page has its own Activate event. The main purpose of the Activate event is to segregate the PeopleCode that is related to a specific page from the rest of your application's PeopleCode. Examples are PeopleCode related to page display or page processing, such as enabling a field or hiding a scroll etc., FieldChange Event FieldChange PeopleCode is used 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 The FieldChange event fires on the specific field and row that just changed. Do not use Error or Warning statements in FieldChange PeopleCode: these statements cause a runtime error that forces the end-user to cancel the page without saving changes.

Peoplecode Events
FieldDefault Event This event allows you to programmatically set fields to default values when they are initially displayed. This event is fired on all page fields as part of many different processes; however it only triggers PeopleCode programs when the following conditions are all true: y The page field is still blank after applying any default specified in the record field properties. (This will be true if there is no default specified, if a null value is specified, or if a 0 is specified for a numeric field.) An Error or Warning issued from FieldDefault PeopleCode will cause a runtime error and force cancellation of the component.  FieldEdit Event FieldEdit PeopleCode is used to validate the contents of a field, supplementing the standard system edits The FieldEdit event fires on the specific field and row that just changed.  FieldFormula Event This is not used in recent applications. Because FieldFormula PeopleCode fires in many different contexts and triggers PeopleCode on every field on every row in the component buffer, it can seirously degrade the performance of the application. FieldFormula is now often used in FUNCLIB_ (function library) record definitions to store shared functions. This is purely a matter of convention, and in fact you can store shared functions in any PeopleCode event.


PeopleCode Events


ItemSelected Event This event fires whenever the end-user chooses menu item from a pop-up menu. Note. This event, and all it's associated PeopleCode, will not fire if run from a Component Interface. PostBuild Event This event fires after all the other component build events have fired. This event is used to hide or unhide pages,to set component variables. PreBuild Event This event fires before the rest of the component build events. This event is also used to hide or unhide pages, to set component variables. The PreBuild event is also used to validate data entered in the search dialog, after a prompt list is displayed. PrePopup Event This event fires just before the display of a pop-up menu. Can be used to control the appearance of the Pop-up menu. Note. This event, and all it's associated PeopleCode, will not fire if run from a Component Interface.

PeopleCode Events
PSControlInit Event This event fires every time the page is redrawn. It fires in the following situations after the component buffers are loaded after a RowInsert or a RowDelete. after a end-user changes a field using a drop down or other prompt after end-user moves up or down a row on a scroll. after a end-user clicks Next or Previous, or any other scroll movement controls. This event is only available with ActiveX controls. The PeopleCode placed in this event should primarily be used for synchronizing the control with the buffer data. It shouldn't be used for any other purpose. Note. PSControlInit is only applicable in the Windows client, not in the PeopleSoft Internet Architecture. Note. If you place an ActiveX control in a scroll that has an occurs count greater than one, the PSControlInit event will fire once for every occurrence. That is, if the scroll has an occurs count of 3, PSControlInit will fire 3 times. Note. This event, and all it's associated PeopleCode, will not fire if run from a Component Interface.

PeopleCode Events


PSLostFocus Event This event fires for an ActiveX control page field when the end-user removes focus from the control. It only fires when the focus completely leaves the control. This event does not fire when the end-user tabs from one field to another within the control. Use this event to move data from the control to the component data buffers. Note. PSLostFocus is only applicable in the Windows client, not in the PeopleSoft Internet Architecture. Note. This event, and all it's associated PeopleCode, will not fire if run from a Component Interface. RowDelete Event This event fires whenever a end-user attempts to delete a row of data from a page scroll. You can use RowDelete PeopleCode to prevent the deletion of a row (using an Error or Warning statement) or to perform any other processing contingent on row deletion. For example, you could have a page field TOTAL on scroll level zero whose value is the sum of all the EXTENSION page fields on scroll level one. If the end-user deleted a row on scroll level one you could use RowDelete PeopleCode to recalculate the value of TOTAL. This event triggers PeopleCode on any field on the row of data that is being flagged as deleted. Note. RowDelete does not trigger programs on Derived/Work records.

PeopleCode Events


RowInit Event This event fires the first time the Component Processor encounters a row of data. It is used for setting the initial state of component controls. This happens during component build processing and row insert processing. It also happens after a ScrollSelect or related function is executed. It is not field-specific: it triggers PeopleCode on all fields and on all rows in the component buffer. Error or Warning statements cause a runtime error and force the end-user to cancel the component without saving. This is often paired with FieldChange PeopleCode. In these RowInit/FieldChange pairs, the RowInit PeopleCode checks values in the component and initializes the state or value of page controls accordingly. FieldChange PeopleCode then rechecks the values in the component during page execution and resets the state or value of page controls. Exception to RowInit Firing This will only occur if all of the following are true: the fields you've placed on the page for that record are all at level 0 the values for every field you've placed on the page are available in the keylist every field you've placed on the page are display only

PeopleCode Events
RowInsert Event

This event fires when the end-user adds a row of data. Used for processing specific to the insertion of new rows. Thist riggers PeopleCode on any field on the inserted row of data. Do not use a Warning or Error in RowInsert: this will cause a runtime error and force cancellation of the component. Note: Do not put PeopleCode in RowInsert that already exists in RowInit, because a RowInit event always fires after the RowInsert event, which will cause your code to be run twice. Note. RowInsert does not trigger PeopleCode on Derived/Work fields. RowSelect Event This event fires at the beginning of the Component Build process in any of the Update action modes (Update, Update/Display All, Correction). RowSelect PeopleCode is used to filter out rows of data as they are being read into the component buffer. This event also occurs after a ScrollSelect or related function is executed. Note. In RowSelect PeopleCode, you can only refer to record fields on the record that is currently being processed. Note. This event, and all it's associated PeopleCode, will not fire if run from a Component Interface.

PeopleCode Events


SaveEdit Event This event fires whenever the end-user attempts to save the component. Can be used to validate the consistency of data in component fields. Whenever a validation involves more than one component field, you should use SaveEdit PeopleCode. This event is not field-specific: it triggers associated PeopleCode on every row of data in the component buffers, except rows flagged as deleted. SavePostChange Event After the Component Processor updates the database, it fires this event. Can be used to update tables not in your component using the SQLExec builtin function. An Error or Warning in SavePostChange PeopleCode will cause a runtime error, forcing the end-user to cancel the component without saving changes. SavePreChange Event This event fires after SaveEdit completes without errors. This gives one last chance to manipulate data before the system updates the database; Can be used to set sequential high-level keys. If this event runs successfully, a WorkFlow event is generated, then the Component Processor issues appropriate INSERT, UPDATE, and/or DELETE SQL commands. SavePreChange PeopleCode is not field-specific: it triggers PeopleCode on all fields and on all rows of data in the component buffer.

PeopleCode Events


SearchInit Event This event is generated just before a search dialog, add dialog, or data entry dialog is displayed. Thist triggers associated PeopleCode in the search key fields of the search record. This allows control processing before the end-user enters values for search keys in the dialog. Can be used to set the value of the search dialog fields programmatically. System defaults and system edits can be switched during the search dialog by calling SetSeachDefault and SetSearchEdit in SearchInit PeopleCode Note. This event, and all it's associated PeopleCode, will not fire if run from a Component Interface. SearchSave Event This event is executed for all search key fields on a search dialog, add dialog, or data entry dialog after the end-user clicks Search. Allows control processing after search key values are entered, but before the search based on these keys is executed. A typical use of this feature is to provide cross-field edits for selecting a minimum set of key information. It is also used to force the user to enter a value in at least one field, even if it's a partial value to help narrow a search for tables with many rows. Note. This event, and all it's associated PeopleCode, will not fire if run from a Component Interface.

PeopleCode Events
Workflow Event This event fires immediately after SavePreChange and before the database update that precedes SavePostChange. The main purpose of the Workflow event is to segregate PeopleCode related to Workflow from the rest of your application's PeopleCode. Only PeopleCode related to Workflow (such as TriggerBusinessEvent) should be in Workflow programs.. Workflow PeopleCode is not field-specific: it triggers PeopleCode on all fields and on all rows of data in the component buffer.

PeopleCode Event Sets


Record Field Event Set 1).FieldChange Event 2).FieldDefault Event 3).FieldEdit Event 4).FiledFormula Event 5).RowInit Event 6).RowSelect Event 7).RowDelete Event 8).PrePopup Event 9).SaveEdit Event 10).SavePreChange Event 11).Workflow Event 12).SavePostChange Event 13).SearchInit Event 14).SearchSave Event

PeopleCode Event Sets

Component Record Field Event Set Component record field PeopleCode is associated with a record field, but only with respect to a component and one of its events. Use this type of association to tailor your programs to a particular component. 1).FieldChange Event 2).FieldDefault Event 3).FieldEdit Event 4).PrePopup Event

PeopleCode Event Sets


Component Record Event Set Component record PeopleCode is associated with a record definition, but only with respect to a component and one of its events. Events are associated with component search records: 1).SearchInit Event 2).SearchSave Event Events are associated with component non-search records: 1).RowDelete Event 2).RowInit Event 3).RowInsert Event 4).RowSelect Event 5).SaveEdit Event 6).SavePostChange Event 7).SavePreChange Event

PeopleCode Event Sets


Component Event Set Component PeopleCode is associated with a component definition and an event. 1).PostBuild Event 2).PreBuild Event 3).SavePostChange Event 4).SavePreChange Event 5).Workflow Event Page Event Set Page PeopleCode is associated with a page definition. This is only valid for pages that are defined as Standard or Secondary. This is not supported for subpages. 1).Activate Event

PeopleCode Event Sets


Page Field Event Set The only control that has PeopleCode associated with it is an ActiveX control. The following events are common to all ActiveX control event sets; 1).PSControlInit Event 2).PSLostFocus Event Menu Item Event Set 1).ItemSelected Event Application Message Event Set These events are not considered part of the Component Processor flow, following events are associated with messages: y OnPublishTransform Event y OnSubscribeTransform Event following event is associated with message subscriptions: y Subscription Event following events are associated with message channels: y OnRoutePublication Event OnRouteSubscription Event

Оценить