Predator
10th October 2009, 15:18
Hi,

Please advise how to handle a message (information type, which the system need us to press OK) pop up from a session in sales order header for example when a changes make on the plan delivery date and plan receipt date.

I am facing a problem on controlling this type of message in AFS.

Thx.

mark_h
11th October 2009, 16:11
It depends on the message. Some messages can just be ignored. You can use stpapi.get.mess.code to get the message. Something like this:

stpapi.update(somesess, 1, err)
errcode = stpapi.get.mess.code(somess, err)
if errcode = "tipgc....." then
stpapi.recover(somesess, err)
endif

You can use something like this to trap the messages and take actions based on the message.

Predator
12th October 2009, 11:43
Hi Mark,

Thank for you reply. the message as per attached cannot be ignored.

In AFS,only question type can be handled.

Please advise.

Thank you.

mark_h
12th October 2009, 16:15
It depends on what you mean by it can not be ignored. If you do not mind the planned receipt date being set to the planned delivery date - then yes you can ignore the message. Now if you do not want this to happen you can do 1 of two things. The first thing you could do is test the dates before calling the session with the stpapi. Here you can give the user a message and handle it before calling the stpapi code - this would prevent the message. The other thing you can try is just what my code does - if you get the error try the stpapi.recover command to restore the original dates. Not sure this one will work - but I use it in another session which gets the same type error. As far as I know for these type warnings you do not have to code something for hitting ok - it should just happen.

Predator
12th October 2009, 17:42
Hi Mark,

Thank for your info.

yashwant
20th October 2009, 15:47
If you are working in LN6, then Why dont you use DAL.It is having great functionlities.

Thanks
Yashwant

Predator
26th October 2009, 09:09
Yashwant,

Can you share more how to call the DAL, appreciate if you can provide a sample.

Thank you.