litrax
10th November 2005, 17:57
Hello,

I am an AFS Newbie and wonder why my session tdsls9249m000 to control the session tdsls4240m000 via AFS doesn't work out.

The session tdsls9249m000 does call the standard AFS functions in the dll tdslsf4240m000. I put all required fields and then call the continue and end function. But in the AFS logfile the return value of the continue function is 0.

I have already searched in this board and read nearly the whole manual but I can't see what I've done wrong.

Please give me a hint...

mark_h
10th November 2005, 19:15
Try only this piece of code:


| form fields
stpapi.put.field(s, "item.f", tdsls041.item )
stpapi.put.field(s, "item.t", tdsls041.item )
stpapi.put.field(s, "cntr.f", cntr.f )
stpapi.put.field(s, "cntr.t", cntr.t )
stpapi.put.field(s, "cuno.f", tdsls041.cuno )
stpapi.put.field(s, "cuno.t", tdsls041.cuno )
stpapi.put.field(s, "orno.f", str$(tdsls041.orno) )
stpapi.put.field(s, "orno.t", str$(tdsls041.orno) )
stpapi.put.field(s, "pono.f", str$(pono.f) )
stpapi.put.field(s, "pono.t", str$(pono.t) )
stpapi.put.field(s, "comp.f", str$(comp.f) )
stpapi.put.field(s, "comp.t", str$(comp.t) )
stpapi.put.field(s, "ddta.f", str$(ddta.f) )
stpapi.put.field(s, "ddta.t", str$(ddta.t) )
stpapi.put.field(s, "tofl.i", str$(tofl.i) )
stpapi.put.field(s, "prin.r", str$(prin.r) )
stpapi.continue.process(s, err.msg )
while true
err.code = stpapi.get.mess.code(s,err.msg)
if isspace(err.msg) then
break
endif
message(err.code&": "&err.msg)
break
endwhile
stpapi.end.session(s)


On a session like this I never put anything but the form fields. Since we do not use this session I think this is all you need to generate with. Of course make sure there is something to generate for this order.

litrax
12th April 2006, 08:30
I've tried this piece of code now. But still the continue.process does nothing.
Im not sure if the enum fields (tofl.i & prin.r) are set in the right way!?
stpapi.put.field(s, "tofl.i", str$(tdsls.tofl.both) )
stpapi.put.field(s, "prin.r", str$(tcyesno.no) )

Perhaps there must be a report controlling (like stpapi.set.report) or is this just necessary when a report is really printed (i.e. in case the field prin.r is "yes")?

Can just somone give me a hint what to do, cause the afs.log says nothing as you see...

Juergen
12th April 2006, 16:02
When a report is printed, the report specs. must have been set.

Example:

stapi.put.field(.....
stpapi.set.report("tdsls4240m000","rtdsls424001000" , printer, err.msg)
if isspace(err.msg) then
stpapi.continue.process("tdsls4240m000", err.msg)
...

Juergen

mark_h
12th April 2006, 16:04
Make sure the report name is correct I think Juergen left off sls in the report name - rtdsls424001000.

Juergen
12th April 2006, 16:11
typing error now corrected.

Thanks Mark.

litrax
12th April 2006, 16:15
Thanks for the hint. I'll try this out. But since it is just "for myself" it will take some time until you hear from me if it had worked now or not.