AlluRajasekhar
9th May 2007, 17:54
Hi,
I have problems with switching index dynamically. I have created a new table with two indexes. The order of fields in indices are ...

Index 1 - "a" and "b"
Index 2 - "b" and "a"

Now I have created a maintain session on this new table with 2 forms in it. The requirement is to show records on form 1 with sort key as index1 and show records on form 2 with sort key as index2. I wanted to do this in program script.

Appreciate your help in achieving this. I tried to search the existing threads but could not find an answer.

Thank you.
Raj

mark_h
9th May 2007, 20:00
One way I did something like this was to have to sessions. Session one had two forms and when form 2 was clicked it would activate session 2. Then in session 2 when you clicked form 1 it would activate session 1. See thisthread (http://www.baanboard.com/baanboard/showthread.php?t=27641&highlight=multiple+tables). I have not seen another way to do this in 4c4.

AlluRajasekhar
9th May 2007, 20:28
Thanks Mark.

jan van dillen
9th May 2007, 21:26
Hi,

You could maybe try to use the to.key() function in the form sections.

Something like:

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

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

AlluRajasekhar
9th May 2007, 22:02
Hi Jan,
It works. I have additionally included execute(first.set) to refresh the screen.

Thank you.
Raj

mark_h
9th May 2007, 23:14
You could maybe try to use the to.key() function in the form sections.


Totally forgot all about that - I was stuck on query.extension commands not available in 4c4. Good Solution!

Hitesh Shah
11th May 2007, 15:37
Hi Jan,
It works. I have additionally included execute(first.set) to refresh the screen.

Thank you.
Raj

If u wish to have the same record shown there , u may use save.rcd.main() in after for section and restore.rcd.main() in before.form section , it will show u the same records .