Search This Blog

Friday, February 19, 2010

Effective Dates usage

Action Type : Update/Display
View : Current, Future
Change : Future only
Insert New Rows : Effective Date Greater Than the Current Row

Action Type : Update/Display All
View : History, Current, Future
Change : Future only
Insert New Rows : Effective Date Greater Than the Current Row

Action Type : Correction
View : History, Current, Future
Change : All Existing Rows
Insert New Rows : Add New Rows with No EffectiveDate Restrictions.

Note. For records that do not contain EFFDT, all actions (Update/Display, Update/Display All,and Correction) operate the same way—they retrieve all existing rows for the specified keys.

Save Processing

A user can direct the system to save a component by clicking Save or by pressing Alt+1.

An application can prompt the user to save a component when the Next or List button is clicked, or when a new action or component is selected. If the user clicks Save after being prompted, save processing begins.

The following actions occur in save processing:

1) The Component Processor initiates the SaveEdit PeopleCode event, which triggers any SaveEdit PeopleCode associated with a record field or a component record.

This enables you to cross-validate page fields before saving, checking consistency among the page field values. An Error statement in SaveEdit PeopleCode displays a message and then redisplays the page, stopping the save. A Warning statement enables the user to cancel save processing by clicking Cancel, or to continue with save processing by clicking OK.

2) The Component Processor initiates the SavePreChange event, which triggers any SavePreChange PeopleCode associated with a record field, a component record, or a component.

SavePreChange PeopleCode enables you to process data after validation and before the database is updated.

3) The Component Processor initiates the Workflow event, which triggers any Workflow PeopleCode associated with a record field or a component.

Workflow PeopleCode should be used only for workflow-related processing (TriggerBusinessEvent and related functions).

4) The Component Processor updates the database with the changed component data, performing any necessary SQL Insert, Update, and Delete statements.

5) The Component Processor initiates the SavePostChange PeopleCode event, which triggers any SavePostChange PeopleCode associated with a record field, a component record, or a component.

6) You can use SavePostChange PeopleCode for processing that must occur after the database update, such as updates to other database tables not in the component buffer.

7) The Component Processor issues a SQL Commit statement to the database server.

8) The Component Processor redisplays the component

Important! Never use an Error or Warning statement in any save processing event other than SaveEdit. Perform all component data validation in SaveEdit.

Reference peoplebooks

flowchart of save processing

Thursday, February 18, 2010

Component Build Processing in Update Mode -flowchart

reference: peoplebooks

Component Build Processing in Add Modes

Component Build Processing in Add Modes

After search processing in add or data-entry modes, the Component Processor:

1) Initiates the PreBuild event.

2) Runs default processing on all page fields.
This enables you to set default fields programmatically using FieldDefault PeopleCode.

3) Initiates the RowInit event on all fields in the component, which triggers any RowInit PeopleCode associated with the record field or component record.

This enables you to initialize the state of page controls, using RowInit PeopleCode, before the controls are displayed. (RowInit enables you to set the values of non-blank fields programmatically, whereas default processing is used to set blank fields to their default values.)

4) Initiates the PostBuild event, which triggers any PostBuild PeopleCode associated with the component record, enabling you to set global or component scope variables that can be used later by PeopleCode located in other events.

5) Initiates the Activate event, which triggers any Activate PeopleCode associated with the page about to be displayed, enabling you to programmatically control the display of that page.

6) Displays a new component, using the search keys obtained from the Add or Data Entry dialog box, with other fields set to their default values.

Event flow

prebuild --> field default ( record field default, component record field default) --> rowinit( record row init, component record row init) --> post build --> page Activate

some of the content taken from peopletools 8.49

Thursday, February 11, 2010

peoplecode event: field default

A field default can be set at 'record field' properties of the record definition. Apart from this, If we talk about setting default value through code for a particular field, we use 'field default' peoplcode event.

Field Default peoplecode can be written at record field and component record field.

This event triggers peoplecode, only If the following conditions are all true.

1) 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 0 is specified for a numeric field.

2) The field has a FieldDefault PeopleCode program.