Baanboard.com

Baanboard.com (http://www.baanboard.com/baanboard/index.php)
-   AFS/DDC/OLE: Function servers (http://www.baanboard.com/baanboard/forumdisplay.php?f=59)
-   -   Unable to get error message in AFS call (http://www.baanboard.com/baanboard/showthread.php?t=70357)

VishalMistry 21st August 2017 13:13

Unable to get error message in AFS call
 
Hi all,

I want to bulk update order system system (tiitm001.osys) to MRP. For this I am passing a text file that contains list of items.

I am deliberately passing an item with MPS order system to check if the system returns same error message as if I am working with Item master session (tiitm0101m000). But, If I check value of error.desc, it remains empty. In fact when I try to change the order system directly through session, I get the error message "Item found in MPS". My code is as given below:

stpapi.put.field("tiitm0101m000", "tiitm001.osys", str$(tcosys.mrp))
stpapi.save("tiitm0101m000", error.desc)

Can anybody guide me how to get the error message ?

Vishal

mark_h 21st August 2017 14:06

Have you tried stpapi.get.mess.code? Are you sure it is an error and not just a warning?

VishalMistry 21st August 2017 14:26

Hello Mark,

Yes. It is an error. I tried to execute the session directly and change the order system, it gave an error message and reverted back to old order system.

I tried to check the value of error as well as mess.
mess = stpapi.get.mess.code("tiitm0101m000", error)

Both are empty after stpapi.save.

Vishal

mark_h 21st August 2017 15:14

Have you tried stpapi.update versus save?

VishalMistry 21st August 2017 15:36

Hi Mark,

My problem got solved after replacing stpapi.save with stpapi.update call.

Thank you for your guidance.

Vishal


All times are GMT +2. The time now is 10:03.


vB.Sponsors
©2001-2017 - Baanboard.com - Baanforums.com