bigblue
10th December 2006, 19:52
I'm attempting to combine 2 different maintain sessions into a single session for our users. They both have only 1 form each and are simple maintain sessions updating their respective tables. I've created the new session and the first form is working as expected because its utilizing the main table, but the second form is left with mostly nulls as it isn't aware of it's table, etc. I'm just looking for guidance as to what changes are required in the script to allow this to work.

mark_h
11th December 2006, 04:21
It seems to me what I saw in one standard session was that the code actually activated a sub-session for the second main table. Form 2 stayed on the screen and the form for the subsession actually looked like it was on form 2. Don't ask me what session because I do not remember - plus I have never tried it. At least that is one solution.

bigjack
11th December 2006, 10:04
i hope foll. link can be of any use to you

http://www.baanboard.com/baanboard/showthread.php?t=27641

en@frrom
11th December 2006, 11:24
The thread BigJack is referring to could be a solution. Note that I have enhanced that session in such a way that the switching between two sessions is for a 100% transparant to the user. So no two icons on the taskbar, no different names on the forms, nothing of that kind...

Another option you should test (I haven't tried it) is to manipulate the predefined variable main.table$. By the books this variable is read only, but in fact (this I HAVE tested in the past) you can change it.

So what I would try: on form 1, leave everything the way it is, and in the before.form section of form.2, you change main.table$ to the desired main table name for the second form (watch the format: "t<package><module><table>"), and program your logic there. Don't forget also to set the correct main.table$ again in the first form's before.form section in case the user jumps back from second form to first...

Please let us know your findings..


Good luck,

Eli Nager

Hitesh Shah
11th December 2006, 18:55
I think using main.table$ may not work becos , the main table queries are initiatialized immediately after before.program and before init.form .

If u try main.table$ then try rebuild.query and then execute(find.data) to set the record pointer to original record . Also u need to check the main.table$ for every statement in main.table.io , update.db , after.update.db.commit etc.