Premahari
20th March 2018, 13:06
Hi I have created one customised session, where it will close purchase orders based on date or order number. My AFS is not working Can anyone give suggestions.

stpapi.put.field("tdpur4223m000", "buy.from.bp.f", " ")
stpapi.put.field("tdpur4223m000", "buy.from.bp.t", "ZZZZZZZZZ")
stpapi.put.field("tdpur4223m000", "purchase.office.f", " ")
stpapi.put.field("tdpur4223m000", "purchase.office.t", "ZZZZZZ")
stpapi.put.field("tdpur4223m000", "order.type.f", " ")
stpapi.put.field("tdpur4223m000", "order.type.t", "ZZZ")
stpapi.put.field("tdpur4223m000", "purchase.order.f", tfacp251.orno)
stpapi.put.field("tdpur4223m000", "purchase.order.t", tfacp251.orno)
stpapi.put.field("tdpur4223m000", "process.upto", " ")
stpapi.put.field("tdpur4223m000", "print.errors",str$(tcyesno.yes))
stpapi.set.report("tdpur4223m000", "rtdpur422301000",device, error )
stpapi.continue.process("ttstpsplopen",error)
stpapi.form.command("tdpur4223m000",5,"exec.cont.process", errmsg)

mark_h
21st March 2018, 14:16
Is tfacp251.orno a string? Make them strings.

Premahari
22nd March 2018, 06:47
I don understand. Why should I make orno as strings? Can u please explain?For order number domain we are using is tcorno right?

giggty
23rd March 2018, 08:14
Also stpapi.continue.process is for Baan IV, so if you are on LN you should use stpapi.form.command(). stpapi.form.command("tdpur4223m000",5,"exec.cont.process", errmsg) seems to be what you need, so just remove stpapi.continue.process("ttstpsplopen",error) line.

mark_h
24th March 2018, 20:00
I don understand. Why should I make orno as strings? Can u please explain?For order number domain we are using is tcorno right?
When using api code all variables need to be passed as strings - so I usually use str$(tfacp251.orno).

Ajesh
6th April 2018, 05:30
stpapi.continue.process("ttstpsplopen",error) is not required,even i think

Did it work using stpapi.form.command??