Syntax
DoSave()
Description
Use the DoSave
function to save the current page. DoSave defers processing to the end of the
current PeopleCode program event, as distinct from DoSaveNow, which causes save
processing (including SaveEdit, SavePreChange, SavePostChange, and Workflow
PeopleCode) to be executed immediately. DoSave can be used only in FieldEdit, FieldChange, or MenuItemSelected PeopleCode.
DoSaveNow
Syntax
DoSaveNow()
Description
The DoSaveNow
function is designed primarily for use with remote calls. It enables a
PeopleCode program to save page data to the database before running a remote
process (most frequently a COBOL process) that will access the database
directly. It is generally necessary to call DoSaveNow before calling the
RemoteCall function. DoSaveNow causes the current page to be saved immediately. Save processing (including SaveEdit, SavePreChange, SavePostChange, and Workflow PeopleCode) is executed before continuing execution of the program where DoSaveNow is called. DoSaveNow differs from the DoSave function in that DoSave defers saving the component until after any running PeopleCode is completed.
DoSaveNow can only be called from a FieldEdit or FieldChange event.
If you call DoSaveNow and there are no changes to save, save processing is skipped entirely. You can call SetComponentChanged right before you call DoSaveNow. The SetComponentChanged function makes the Component Processor think there are changes and so will force full save processing.