mgakhar
12th November 2002, 01:25
Hi,
We've created a function server dll using ttstpcreatdll for Sales Orders. We needed to generate Sales Order and Lines.

The generation of Sales Order header works just fine. However, for the Lines, when we call the tdslsdllsoline.end() function, it doesnt switch back to the parent process (header).

The Sales Order Lines script has some changes like

if not api.mode then
switch.to.process(parent)
endif

As a result when I try to end the header process, it hangs.:mad:

Any idea as to how to get around this problem ??:confused:

Im attaching my code making calls to the functionserver dlls

tdslsdllslshdr.put.Sales_Order(orno)
tdslsdllslshdr.find()
tdslsdllslshdr.handle.sub.process("tdsls4105s000", "add") |* Sales Order Line session (Wholesale)

tdslsdllslshdr.continue(err.mess)
if isspace(err.mess) then
temp.orno = tdslsdllslshdr.get.Sales_Order()
|tdslsdllsoline.put.Sales_Order(temp.orno)
tdslsdllsoline.put.tdsls041.item(item)
tdslsdllsoline.put.Ordered_Quantity(qty) |* FS will do the check
tdslsdllsoline.put.Price(price)
pric = tdslsdllsoline.get.Price()
|tdslsdllsoline.put.Amount(amount)
tdslsdllsoline.put.tdsls041.odat(date.num())
tdslsdllsoline.handle.sub.process("tdsls0130s000", "kill")
tdslsdllsoline.insert(1, err.mess)
tdslsdllsoline.save(err.mess)
ret.pono = tdslsdllsoline.get.Position_Number()
tdslsdllsoline.put.Price(price)
tdslsdllsoline.update(1,err.mess)
tdslsdllsoline.save(err.mess)
tdslsdllsoline.end()
endif
tdslsdllslshdr.end()

mark_h
13th November 2002, 01:25
You could try the ignore or the send options on the handle subprocesses. Just a guess on something you could try.

Is there a main session for Maintain sales order lines? If so you can use it to maintain the lines instead of the subsession. Not sure if this is viable, but thought I would bring it up.

Mark

gfasbender
13th November 2002, 02:13
I'm always a little concerned when I see a sub.process call with the "kill" option.

tdslsdllsoline.handle.sub.process("tdsls0130s000", "kill")

When your process hangs, I bet session tdsls0130s000 is loaded and still running? I don't have access, so I'm not sure what tdsls0130s000 is, or if you need to use it in your process. Try changing the "kill" to an "add" in the sub.process() call for session tdsls0130s000, and then adding an end() call for it also just before tdslsdllsoline.end().

mgakhar
13th November 2002, 19:59
I've been talking to Baan support and they say that it is a bug with the ottstpapihand object and they still havent released this object with this bug solved for BaanIV c3 version. Hopefully once I get the object this problem should be solved.

Will keep the forum updated.

Thanks,
MG.