garlapati
1st February 2013, 09:48
I am trying to automate tssma3101m000 (Service order creation) in B4c3.
1. Ususally when you use AFS to update /insert record on a session it won't display/popup the target session. But in my case it is poping up the target session :confused: . any parameter to make if off/run background?
2. And the record is not getting inserted & after exit it is going to recover function.

below is the code i have written. Any suggestions for above issues?

stpapi.put.field("tssma3101m000", "sma.grno", "0")
stpapi.put.field("tssma3101m000", "tssma301.desc", call.desc)
stpapi.put.field("tssma3101m000", "tssma301.sert", str$(etol(tssma.sert.call)))
stpapi.put.field("tssma3101m000", "tssma301.cctp", "TR")
stpapi.put.field("tssma3101m000", "tssma301.cins", str$(inst.seqn))
stpapi.put.field("tssma3101m000", "tssma301.telp", cust.telp)
stpapi.put.field("tssma3101m000", "tssma301.refe", cust.cont)
stpapi.put.field("tssma3101m000", "tssma301.refe", cust.orno)
stpapi.put.field("tssma3101m000", "tssma301.ddt1", str$(extract.date(rep.date)))
stpapi.put.field("tssma3101m000", "tssma301.dtm1", str$(convert.time.to.num(rep.time)))
stpapi.put.field("tssma3101m000", "tssma301.csym", call.symp)
stpapi.insert("tssma3101m000", error.msg)
if not retval1 then
stpapi.recover("tssma3101m000", error.msg)
else
stpapi.get.field("tssma3101m000", "tssma301.orno", serv.orno)
endif
stpapi.end.session("tssma3101m000")

Appreciate the quick help.

Regards
Sunil

mark_h
1st February 2013, 21:38
There is nothing that I know of that should make the sessions pop up in the foreground. I would contact Infor on that issue.

As for the code going to the recover section - what is the error.msg from the insert? Print that out. I suspect it is one of the input fields. Can't say for sure without the error. I would make sure you have all the correct values and the correct string format for the calls.

garlapati
4th February 2013, 08:54
We don't have support contract with Infor since long time.

I am not getting any message in error.msg. its empty. I kept the session in debug to see if it is going out due to any input fields. but to my observation no such issue. the trace is not going to the other fields at all except the order number series. from there it is exiting & going to recover.
Clueless & i understand with out seeing this side its tough to answer what happening in this case.

mark_h
4th February 2013, 16:06
I did just notice something:

stpapi.insert("tssma3101m000", error.msg)
if not retval1 then

Is it a typo or do you need to make sure retval1 is set from the insert like below?

retval1 = stpapi.insert("tssma3101m000", error.msg)
if not retval1 then


Sorry not much I can think of about it popping up in the foreground. Maybe compare session settings to anther main that does not do this. Maybe something in the tssma3101m000 code causes it to happen.