Salesforce

CtrlGoto (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

CtrlGoto (Magic xpa 4.x)

Moves the cursor to a selected control.

Syntax:

CtrlGoto('control name',row number,generation)

Parameters:

control name: A string value surrounded by single straight quotation marks (' ') that represents the name of the control on which you wish to park.

row number: The nth row in a Table control where the control is located. The Zero value will be considered as the current row. This parameter is ignored if the control appears only once in the table.

generation: A number that represents the task's hierarchic position in the runtime task tree. 0 represents the current task, 1 its immediate ancestor, and so on. Task 1 would switch focus to the parent task.

Returns:

The function returns a True value if it is successful in finding the control by name and row in the window of the given task.

The function returns a False value if the selected control name is not found, the control is invisible, the specified row does not exist, the referenced task has no window, or the referenced task does not exist.

Example:

CtrlGoto('Customer_Name',3,0) switches the focus to the control of Customer_Name in the 3rd row of the table in the current task's window.

Note:

When the CtrlGoto function is used, Magic xpa internally adds a Control Hit event to the runtime events queue. This means that the control will get focus asynchronously after the event is extracted from the queue (when the application becomes idle).

The row number relates to the visible rows; this means that if the table shows 10 rows, a value of 11 will be ignored. If you want to go to a record that is not visible, use the LocateAdd function.

For Online tasks, if the control you want to go to is a subform or a frame, then the CtrlGoto function cannot be used in the Task Prefix or Record Prefix logical unit since the subform’s task is not loaded yet. Instead you can raise a user event with Wait=No from the Task Prefix or Record Prefix and use the CtrlGoto function in it.

See also:

How Do I Make the Cursor Jump to a Specific Control?

The Online and Rich Client Samples projects (program LG10 and RLG10)

Reference
Attachment 
Attachment