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.
flowchart of save processing