Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > AFS/DDC/OLE: Function servers

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 26th October 2017, 15:47
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 573
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Wink Error updating warehouse in tisfc001 through AFS

Hi all,

I am trying to change warehouse in production order through AFS. I am passing production order number and project using stpapi.put and checking the return value of stapi.find. I am able to find the record, but when I am trying to update the warehouse by passing new warehouse in stpapi.put, I am getting an error message when I call stpapi.update. The error message is "Item not found".

When I run the session directly and try to update the warehouse in same production order, I am able to do it. I have attached screen that performs warehouse update in tisfc001.

I have attached script for reference.

Shall be grateful if anybody can point out the error.

Vishal
Attached Files
File Type: cln tisfc001_update.cln (4.8 KB, 18 views)
Reply With Quote
  #2  
Old 26th October 2017, 20:50
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,934
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Is this 4c4 or LN? I read in one post it would be better to use DAL functionality on LN.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Sponsored Links
  #3  
Old 27th October 2017, 11:12
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 573
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Wink It's Baan IVc4

Hello Mark,

We are on Baan IVc4. In a simple way If I ask, Generally what would be the code to find particular production production order and change warehouse in it.
I would appreciate if any example is given.

Thanks,
Vishal

Last edited by VishalMistry : 27th October 2017 at 13:05.
Reply With Quote
  #4  
Old 27th October 2017, 14:42
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 573
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Red face

The issue is resolved by introducing two variable which are used in QKey layer of tisfc0101. But now, whenever any error occurs, the error.msg in stpapi.update captures only last message (which is not the actual reason for update failure).

The error is "Actual calendar not found when planning for work center 05"

The message following the error is "Estimated BOM and routing will be reset to standard".

And the error.msg captures the second message(Estimated BOM and routing will be reset to standard)

Anybody has any clue how to capture the first error message in error.msg while doing stpapi.update ?

Vishal
Reply With Quote
  #5  
Old 27th October 2017, 15:03
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,934
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Glad you found a solution. We have qkey on the session also - but right now in test our third party software is not hooked up. That is causing trigger errors when I tried to run your code (without project, since we do not use it).

As for trapping the first error from the documentation I see this:

Message array
Messages raised by the session are kept in an array, with a maximum of 20 messages. When more messages are raised, the 21st message will be: more than 20 messages raised by the session, other messages are lost.
The function stpapi.get.mess.code() gives access to this array. The array has two fields: error code and error text. The error code can be empty for messages raised by the function message(). In the first call to this function, the last message is returned, then the previous one, and so forth.
Example of message array:
Code Text
dtfsas0002 Price must be filled
dtfsas0001 Note: insufficient inventory

In this example, the session first raised a warning (in check.input of the quantity field) with only a mess() function. In the check.input of the Price field set.input.error(dtfsas0002) was called (or mess(dtfsas0002, 1) followed by set.input.error(“”)). The string “Price must be filled” is also returned in the error argument of the stpapi.insert() call.
When the message array only contains the warning dtfsas0001, no string is returned in the error argument of the stpapi.insert().
See the example code in Chapter 3 how to handle the message array.
Before each stpapi.* call, the array is cleaned up, except stpapi.put.field(), stpapi.get.field() and stpapi.get.mess.code().

So I would think if you stpapi.get.mess.code it would return the estimated bom message the first time. Then the second call to stpapi.get.mess.code would return the Actual calendar error. Never really tried it myself.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Afs for Outbound Lines at warehouse order not working... patwanirav Blogs and Web links 1 26th July 2013 12:24
AFS not working for outbound lines at warehouse order patwanirav AFS/DDC/OLE: Function servers 3 26th July 2013 06:04
afs to make and confirm warehouse receipt kanikahada AFS/DDC/OLE: Function servers 1 25th January 2013 15:36
AFS waiting timed out (frozen) jp.aalders AFS/DDC/OLE: Function servers 4 20th December 2011 21:48


All times are GMT +2. The time now is 00:35.


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