Prompt

Mon 01 January 2018

Syntax

Prompt(title, heading, {fieldlist | &Record})

where fieldlist is an arbitrary-length list of fields in the form:

field1 [, label1 [, tempvar1]] [, field2 [, label2 [, tempvar2]]]...

Note that the label parameter is required before the temporary variable.

Description

Use the Prompt function to display a page prompting the user to insert values into one or more text boxes. If the user cancels the page, any entered values are discarded and the function returns False. When the prompt page is displayed, the text boxes are initially filled with default values from the fields in fieldlist . The user can change the values in the text boxes, then if the user clicks OK, the values are placed either into the buffer for the appropriate field, or into a temporary variable, if a tempvar for that field is provided in the function call.

Prompt can also take a record object. This is primarily used with the Query classes, when running a query, to prompt the end user for the prompt values of a query.

Prompt is a think-time function, and as such cannot be used during the PeopleCode attached to the following events:

  • SavePreChange

  • Workflow

  • RowSelect

  • SavePostChange

  • Any PeopleCode event that fires as a result of a ScrollSelect (or one of its relatives) function calls, or a Select (or one of its relatives) Rowset class method.

Prompt should also not be called in any PeopleCode event that fires as a result of a ScrollSelect or its relatives, or a Select Rowset class method or its relatives.

Parameters

Field or Control

Definition

title

Used as the title for the page.

heading

Displayed in the page above the fields. If a zero-length string ("") is passed, the heading line is omitted in the page.

fieldlist | &Record

A list of one or more fields; each field in the list consists of a [ recordname .] fieldname followed by an optional label and an optional temporary variable for storing the input value. The label parameter is required if you supply the temporary variable parameter.

Instead of a list of fields, you can also specify an already instantiated and populated record object.

field

The name of the field being prompted for, the form [ recordname .] fieldname .

label

Optional label for the prompted field. If this parameter is omitted, the field RFT Long value is used. This parameter is required before the tempvar parameter.

tempvar

Optional temporary variable to receive the user-entered value. If this parameter is omitted, the value is placed into the buffer for the field specified. Using a temp variable enables the PeopleCode program to inspect and process the entered value without affecting the buffer contents.

Returns

Optionally returns a Boolean value:

  • False if the user clicks the Cancel button.

  • True if the user clicks the OK button.