en@frrom
25th May 2005, 17:24
When hitting a button in session A, AFS is activated on session B. What I need is that session B will be started in API mode, and will activate its form command of type session - let's call it session C - while session C should be started in user interface mode. I.e. user should not go through session B, but should get session C with its forms etc, so that the user can select a record from session C, and this will be returned again through the AFS via session B to session A.

Can anyone help me out here please? I am new to AFS

mark_h
25th May 2005, 18:32
I do not think this can be done. I know of no method that would allow you to start session A & B thru AFS, then bring up session C for user interaction. Typically what I do is I give the user what fields they would need on my AFS session and I run sessions A,B, C in the background using AFS code. Maybe if you mentioned what sessions you are talking about using this with others can make recommendations or relate how they handled what you are talking about.

mark_h
26th May 2005, 00:05
Okay - trying to fix a problem with all the wms crap that baan added into receiving I found that if you set api.mode=true, then the next session called will come up interactively. It was not pretty in my case. I was testing maintain approvals and it brought up the tdilc4123s000 session. I could enter information and save, but I could not close it. I did not play with this more so I do not know if it would really work - plus you probably need the code to the session.

en@frrom
30th May 2005, 14:19
Mark, first of all thanks for the responses, and second: my apologies for the late reply. What do you mean with your second post? DOn't get it? You mean I should set api.mode = true/false? In which session (A,B,C)? How/why would that work? Please explain in detail; I'm completely new to AFS.

Regarding the sessions in question: all three sessions are fully customized sessions.

Thanks,

En

mark_h
30th May 2005, 15:54
What I have is the maintain approvals session - when you click in the quap field it should launch tdilc4123s000 on our system. Using the API commands would not work. I looked and the source code and in the before input Baan had put code that was something like this:

field.tdpur045.quap:
before.input:
if somecheck and somecheck and NOT API.mode then
zoom.to.ilc()
endif


So what I played with(using qkey) was doing something like this:

field.tdpur045.quap:
before.input:
if var = "MARKAPI" then
api.mode = false
endif
if somecheck and somecheck and NOT API.mode then
zoom.to.ilc()
endif


Not the exact code but something in this format. Anyway, when my program did an stpapi.update on tdpur4121m000, it launched the tdilc4123s000 session and brought it to the foreground. The program was no longer in api.mode, I entered my fields and clicked continue. The receipt finished okay, but I then could not close tdilc4123s000. So in your case in session C in the before.program you could always set api.mode = false. This would cause session C to come to the foreground and the user could enter data. The only problem is closing and going back into api.mode for sessions a and b. I am not sure what all would happen since I stumbled upon this - I thought api.mode was a read only variable.