kruyoupatel
29th June 2015, 15:18
Hello Guys,
I am stuck with simple problem.
There's a code in before.program section which throws message.
My code is unable to fetch that message.
Similar is the case in one more session where message is triggered in after.choice with no choice.again().
Can anyone suggest how to receive this messages in AFS?
These are warning/critical messages and not error message.
i tried with stpapi.get.mess.code but didn't receive any error in it.:confused:
mark_h
29th June 2015, 15:47
What is the session? Do you know what causes the messages to get displayed? I know for a few sessions I code in checks just to make sure certain errors or messages do not occur.
kruyoupatel
29th June 2015, 17:40
Hi Mark,
Session is Audit Payments (tfcmg1255m000) BaanIV.
Code written in before.program was to check the Payment Authorization.
Also in one of my custom session we providing a message pop-up for created Batch.
But in case of AFS that message is ignored. Even stpapi.get.mess.code() gives empty string.
mark_h
29th June 2015, 17:55
Yeah - if the message is only a warning the stpapi.get.mess.code does not always catch it. The problem is in the background the session keeps running and does not wait for something like an okay to clicked. So by the time you execute the stpapi command the message is gone(or cleared). At least that is my theory.
Have you tried multiple stpapi.get.mess.code? See if maybe there might be multiple messages or something - according to documentation it will hold upto 20 messages or warnings. Never really tried it myself - I either code around it, or code to prevent the warning.
mark_h
29th June 2015, 17:56
Also - can you post the relevent piece of code. Wondering how and when the session gets started.
bhushanchanda
29th June 2015, 22:30
Also, you can try exporting a variable and then importing it back using
export("api.error.mesg" ,api.error.mesg)
and
import("api.error.mesg" ,api.error.mesg)
And, if not, then, you need to have Payment Authorization for the user id to run the session without any issues. That sounds like a better solution over this.