iscons
27th August 2016, 02:11
I have a message that requires the user press to the OK button when the tdilc4113s000 session is run manually.

when executed using AFS the message causes the insert to return 0 which is false and means it failed.

How to I use something similar to ask.enum to provide the OK answer to the message?

the message code is tdilc40062, I tried to use ask.enum to suppress it but that does not work.


stpapi.handle.subproc("tisfc0202m000","tdilc4113s000",msg)
stpapi.continue.process("tisfc0202m000",msg)
stpapi.put.field("tdilc4113s000","tdilc402.item",item)
stpapi.put.field("tdilc4113s000","tdilc402.clot",lot)
stpapi.put.field("tdilc4113s000","tdilc402.date",str$(shit.date))
stpapi.put.field("tdilc4113s000","tdilc402.qstr",str$(quantity))
rc = stpapi.enum.answer("tdilc4113s000","tdilc40062",tcyesno.yes)
rc = stpapi.insert("tdilc4113s000",1,msg)

error.code = stpapi.get.mess.code("tdilc4113s000",msg)

bhushanchanda
27th August 2016, 06:40
Hi,

Try stpapi.enum.answer before putting any fields.


stpapi.continue.process("tisfc0202m000",msg)
stpapi.handle.subproc("tisfc0202m000","tdilc4113s000",msg)
stpapi.enum.answer("tdilc4113s000","tdilc40062",tcyesno.yes)
stpapi.put.field("tdilc4113s000","tdilc402.item",item)
stpapi.put.field("tdilc4113s000","tdilc402.clot",lot)
stpapi.put.field("tdilc4113s000","tdilc402.date",str$(shit.date))
stpapi.put.field("tdilc4113s000","tdilc402.qstr",str$(quantity))
rc = stpapi.insert("tdilc4113s000",1,msg)

Also check this similar thread (http://www.baanboard.com/baanboard/showthread.php?t=68201)