klesch
11th July 2003, 16:18
Is it possible to change index that is used by sesssion from program script?

With other words: I need to do something like
execute(change.order),
but I want to choose the index number from the script, not by the user.

Why I need this? I have the session with two forms. I want to use the index 1 on form 1 and the index 2 on form 2.

Any ideas?

estotz
11th July 2003, 20:12
Use the "to.key" function.

form.1:
init.form:
to.key(1)

form.2:
init.form:
to.key(2)

morpheus
12th July 2003, 08:26
To change the key of a table other than the main table, use db.change.order().

xiraba
25th August 2003, 22:33
Hi, I have the same problem, but is not working...

I have a session, and this session has 2 forms. The first one use the main table tipcs022 and the index1, but when I change it to form 2, the same table use the index4.
Until now everything is ok, but when I press "start.set" (the "S" button for ASCII mode) the main table use the primary key, and not the key that I wanted.

The session tibom1110s000 has the same engine, and working, but the session tibom1110m000 share the same script and it doesn´t work.

Could someone help me?

Thanks!

NvanBeest
26th August 2003, 10:46
Copied from Baan's standard help about the to.key function:

During the options ADD.SET, MODIFY.SET and MARK.DELETE the current key is saved and the primary key is made current. After updating the database the standard program switches back to the saved key.