Think-Time Functions
Think-time functions suspend processing either until the user has taken some action (such as clicking a button in a message box) or until an external process has run to completion (for example, a remote process).
Avoid think-time functions in the following PeopleCode events:
-
SavePreChange.
-
Workflow.
-
RowSelect.
-
SavePostChange.
-
Any PeopleCode event that executes as a result of a ScrollSelect, ScrollSelectNew, RowScrollSelect, or RowScrollSelectNew function call.
-
Any PeopleCode event that executes as a result of a Rowset class Select or SelectNew method.
Violation of this rule can result in application failure.
The following are think-time functions:
-
Calls to an external DLL.
-
DoCancel.
-
DoModal and DoModalComponent.
-
Exec (this is think-time only when synchronous).
-
File attachment functions AddAttachment, DetachAttachment, MAddAttachment, and ViewAttachment.
-
CropImage and InsertImage.
-
Object functions, such as CreateObject, ObjectDoMethod, ObjectSetProperty, and ObjectGetProperty (these are think-time only when the object requires user action).
-
Prompt.
-
RemoteCall.
-
RevalidatePassword.
-
WinExec (think-time only when synchronous).
-
WinMessage and MessageBox (depending on the style parameter).
Important:
On the initial loading of a component (initial page Activate event), it is recommended that you allow the component to render correctly before you call any modality that requires user interaction (think-time functions).
If you call any modality that requires user interaction during the initial page Activate event, except if its a message box with only an OK button, the user interaction suspends the processing of the page load leading to undesired rendering. For example, the message box (with more than one button) loses its styling, and the rendering of the page and component is corrupted. If you use DoModalPopup or DoModalComponentPopup, you should note that it will render as a full page.