SetCursorPos

Mon 01 January 2018

Syntax

SetCursorPos(Page.pagename, scrollpath, target_row, [recordname.]fieldname)

where scrollpath is:

[RECORD.level1_recname, level1_row, [RECORD.level2_recname, level2_row, ]] RECORD.target_recname

To prevent ambiguous references, you can use SCROLL. scrollname , where scrollname is the same as the scroll level’s primary record name.

Description

Use the SetCursorPos to place the focus in a specific field anywhere in the current component. To transfer to a page outside the current component, use Transfer.

Note: If you use SetCursorPos to change the focus to a field that is not on the current page, any PeopleCode associated with the Activate event for the page being transferred to runs.

You can use the SetCursorPos function in combination with an Error or Warning function in SaveEdit to place the focus on the field that caused the error or warning condition. You must call SetCursorPos before an Error statement, because Error in SaveEdit terminates all save processing, including the program from which it was called.

Parameters

Field or Control

Definition

Pagename

The name of the page specified in the page definition, preceded by the keyword Page . The pagename page must be in the current component. You can also pass the %page system variable in this parameter (without the Page reserved word).

scrollpath

A construction that specifies a scroll level in the component buffer.

[ recordname . ] fieldname

Specify a field designating the record and field in the scroll where you want to place the cursor.

target_row

The row number of the row in which you want to place the cursor.

Returns

None.