manusatsangi
13th August 2003, 11:06
Hi,
In standard BaaN package, a session "Maintain TDS Deductions" (tfacp9139s000) is invoked from "Special" of session "Maintain Bank Transactions" (tfcmg2100s000).
Now, I have developed another session which also invokes the session ""Maintain TDS Deductions" (tfacp9139s000) in the same way via "Special".
Now I notice that when this TDS session is started from the standard session tfcmg2100s000, it works well. (i.e. it starts in Insert mode), but when I start from my customized session the TDS session does not start in the same way. i.e. it does not start in insert mode.
Moreover, I have not created a new program script for the customised session, but used the script of "Maintain Bank Transactions".
Does that mean that TDS session is somewhere hard-coded to get invoked from the standard session tfcmg2100s000 only. Is my thinking right?
Moreover, when a session gets invoked from "Special" of another session, what all sections/subsections are executed in the called session.
It is difficult to solve this problem more so because I do not have the source code of the standard TDS session and Bank Transaction session.
Plase help me over this.
Warm Regards
Manu
morpheus
13th August 2003, 14:49
Manu,
Try the following option -
On the first form of the session ttadv2100m000, there is a field Start Option. Change the option here to add.set. This will open the session in the Insert mode.
manusatsangi
13th August 2003, 15:12
Hi Morpheus,
Thanks for the help.
If you mean that I change the start option of session "Maintain TDS Deductions" then I did it and it is not working.
As a matter of fact, this session did not have a start option earlier. That means, it is programmatically controlled.
Moreover, such types of sessions in which you enter some "extension" data, I have found out that, if info is already maintained then the session just displays the record, if not maintained then automatically goes to add record.
I would be grateful if you could think of more options.
What are the ways in which a called session can be hard-coded to behave in a specific way if it is called from anotehr specific session.
One way to do is code in section
zoom.from.<session-no>
But, since this called session is invoked from "Special", hence zoom from sections are not called.
Warm Regards
Manu
Andreas
13th August 2003, 16:47
Hi Manu,
the behaviour of the called session is coded, like you already mentioned, in this session.
Suppose the following:
Session 1 has a call of Session 2 via Special Menu.
Construct in Session 2:
before.program:
startup = true
form.1:
init.form:
or
before.form:
if startup = true then
if check.if.record.present() then
execute(find.data)
else
execute(start.set)
endif
startup = false
endif
this is why it starts in display mode when a record is present and in insert mode when no record was found.
Hope this helps,
Greetings
Andreas
NvanBeest
14th August 2003, 15:16
Hi Manu
Referring to this piece from your earlier post:
One way to do is code in section
zoom.from.<session-no>
But, since this called session is invoked from "Special", hence zoom from sections are not called.
This is a wrong assumption. Adding a special option to a form results in a "user.x" option. To have such a "Special" option do anything, you will have to add a choice.user.x section to your code, and, in the on.choice of this, you will have to call the session that you want. In BaanIV, this starting of a subsession is done by the function zoom.to$, therefore the zoom.from sections WILL be called. Since you use the script of "Maintain Bank Transactions", this behaviour stays the same.
In the session "Maintain TDS Deductions", the code probably checks the name of the parent/calling session, and acts on that. Your new session will have a different session code than "Maintain Bank Transactions", therefore the reaction of the called session is different as well.
gfasbender
14th August 2003, 15:29
Nico,
This is a wrong assumption. Adding a special option to a form results in a "user.x" option. To have such a "Special" option do anything, you will have to add a choice.user.x section to your code, and, in the on.choice of this, you will have to call the session that you want. In BaanIV, this starting of a subsession is done by the function zoom.to$, therefore the zoom.from sections WILL be called. Since you use the script of "Maintain Bank Transactions", this behaviour stays the same
This is true in Baan4, which it looks like Manu is running. But in Baan5, you can zoom directly to a session from without having a choice.user.x section.
NvanBeest
14th August 2003, 15:33
Hi gfasbender
Quite true. But since Manu's profile states "Baan IV c4", this seems to be the only explanation of what is going wrong.
manusatsangi
18th August 2003, 14:04
Dear All,
Thanks a lot for helping me get out of trouble.
As mentioned by NvanBeest..
In the session "Maintain TDS Deductions", the code probably checks the name of the parent/calling session, and acts on that. Your new session will have a different session code than "Maintain Bank Transactions", therefore the reaction of the called session is different as well.
That is what I wanted to know how does the called session determine from where is it being called?
Moreover, To determine whether the zoom.from sections are being executed in the called session or not, I did a simple test.
Using bic_info, I generated a script of my own and used the external functions of the object "TDS Deductions". Then, I started using this script of my own, instead of the original object on the session "Maintain TDS Deductions".
I tested this object, and as with the original object it was working fine with standard session "Bank Transactions" and now working with my developed session. Hence, I went ahead with assumption that I have not impaired the functionality of the original object.
Now, I debugged the object and set a break-point of zoom.from.all section.
When I ran the session, the break-point was not hit at all. It means that zoom.from section was NOT executed, in the generated script.
Hence, I also concluded that the zoom.from section of the original script is NOT executed.
Do you think there is a mistake in my understanding?
Warm Regards
Manu
NvanBeest
18th August 2003, 14:13
Manu
Could you please post the generated code? It would help a lot!
manusatsangi
18th August 2003, 14:40
Dear NvanBeest,
Please find attached the generated code.
The object attached with tfacp9139s000 was otfacp9139. Now I created ptfacp9139c01 and attached with the session.
Regards
Manu