Solved

How to use cursor_to_col_id in Default procedures

  • 10 March 2020
  • 7 replies
  • 226 views

Userlevel 5
Badge +20

What is the purpose of the parameter cursor_to_col_id?

I tried to move the cursor to a specific next field after moving another field. 

Just adding a statement like below, does not make any difference.

SET @cursor_to_col_id = 'document_number'

Could anybody give an example or explanation on how to do this? 

 

icon

Best answer by Frank Wijnhout 11 March 2020, 09:04

View original

This topic has been closed for comments

7 replies

Userlevel 5
Badge +5

This is indeed the way to use it.

Note that the GUI could be a little picky whether to listen to this setting from the SP dependent on how you left the previous field. This will not work when you leave the previous by mouse for example.

Which GUI we are talking about?

Userlevel 6
Badge +16

This seems to only work when using enter to apply the change. Using tab or the mouse ignores the setting and just goes to the next field. 

Userlevel 5
Badge +20

Actually this is what I try to do now.:

IF @cursor_from_col_id = 'document_number' AND @invoice_id IS NULL 
IF EXISTS (SELECT 1 FROM invoice WHERE document_number = @document_number)
BEGIN

EXEC dbo.tsf_send_message 'document_number_already_exists', NULL, 0

SET @document_number = NULL
SET @cursor_to_col_id = 'document_number'

RETURN
END

Whatever I try, it does not work. Even when I remove the tsf_send_message line.

The model is in 2019.1, the GUI is Windows 2020.1.12

The output of the procedure, seems to be correct.

Userlevel 6
Badge +16

does it also not work when applying the change to the column document_number using the enter key? It works perfectly fine if i use enter. 

Userlevel 5
Badge +20

Yes, only when using the Enter Key it works fine.

Good to know this, but also the Tab key is often used by users.

Is there any reason to not enable this option?

In my example tsf_message, is triggered in any case (mouse, tab, enter) on wrong input

 

The tab key on a keyboard is used in Windows to advance the cursor to the next tab stop. This is not something we want (or can?) override in the GUI. 

Therefore we use the Enter key for going to the next field. Enter skips the buttons behind fields, Enter lets the cursor go to a next tab page when leaving the last field on a tab page and it also responds to @cursor_to_col_id.

 

Userlevel 3
Badge +11

It seems that this parameter does not work in the mobile GUI? Is that correct? We have a task where we need to scan a barcode whith a barcode scanner. We want to set the cursor actively in the field which should be set active before scanning.

On every scanning task the user always need to activate the field first before he’s able to scan?

Does anyone know about this behaviour?