Nick Cooley
22nd June 2010, 06:00
Hi all,

Having my first go at using AFS in the transport module. We have a customised session that is based on trtoc1184s000. An option is to zoom to maintain other lines session trtoc0560s000. A display session that lists the other line types, of which we only have invoice lines available. I can get our customised session started and inserting lines, but when I call trtoc0560s000 my AFS dies with the following
Fatal error : Illegal value for size argument (0) for sym 'baanapi_input_data'
Fatal error : Can not continue in trtoc0560s000 in DLL : ottstpstandard(<28>)

My problem seems to be as soon as I activate the display session vaiables are not set correctly. The code from the session looks like this :

if background then
fast.return = false
import("from.cpro",from.cpro)
import("from.kipo",from.kipo)
import("cont.orno",cont.orno)
import("cont.refp",cont.refp)
import("cont.kipo",cont.kipo)
import("cont.cpro",cont.cpro)
I have found unless I use the zoom.option command, the variable background is not set, so my import of variables never happens. And code further on needs the first two variables to be set.

So I need to get from.kipo and from.cpro set using a put.field. However, if I use a put.field before my zoom, then I get the background variable not set problem.

Anyone successfully called this session in AFS? I seem to be going around in circles.

Or do I need to make changes to the Baan code for trtoc0560 (which I do have).

Thanks in advance.

mark_h
22nd June 2010, 14:14
Are you on the latest toolset and stpapi patches?

Nick Cooley
22nd June 2010, 23:44
I'm picking we are not. On Baan IVC4, service pack 8 so pretty old.
We haven't upgraded to the heavy customisations we have, which meant a service pack upgrade was a major mission. But being on this SP has not caused us any problems to date, hence we havn't changed.

Would the toolset/stpapi version make much difference to the problem we are experiencing?

Thanks.

mark_h
23rd June 2010, 19:14
It could very well be the issue. Along the way to our current SP we had a couple that completely broke our API code. In those cases we had to go and do a tools update, portingset updates, etc. It varied from issue to issue on what we had to update.

You can try changing the code to work around the issues, but no guarantee it will solve the problems. So in that one sessions you could do:

if api.mode then
import()
import()
endif

The code might work, but not sure the baanapi input error would go away.

Nick Cooley
5th July 2010, 05:40
So, after much frustration, I did the honourable thing - gave up. But not quite. Instead I added the session trtoc1184s000 as a new sub session to my customized session and got that working instead.

Running code from AFS also didn't seem to like the use of 'break' in case statements, but only some of the time ... curious ...

mark_h
7th July 2010, 15:21
Interesting about the break in case statements. Wish we owned source code so I could check things out on. I have run into the same type thing with subsessions - I can't remember the name of the session, but there was one I had to do the same thing on. In was generate requirements type session. Would not run in the background, so I made it a zoom.to session to solve the problem.