Thomasm
25th October 2006, 14:33
Hello,

I have upgraded my test server from sp12 to sp20 and also to the porting set 6.1c.07.11. I have now found that the function stpapi.change.view is acting differently than before and also different than the documentation I have (document U8627A US delivered together with the SP solutions). The documentation says that the return values can be 0, 1 or 2. 1 meaning found, 2 meaning another record found (err.msg not filled) and 0 meaning unsuccessful and err.msg filled. This is according to older documentation and how it used to work.

In my example I am now working in session tihra1101m000 and setting the values to year, week and employee and then do a stpapi.change.view into a view where there are no records yet. Before the function would return 2 in this situation but now it suddenly returns 0 BUT the err.msg i not filled.

If I in this situation ignore my error handling and continue with setting data to the different fields and then do the insert I can see that the insert is successful (no error returned) and I can also see in the session manually that the record was indeed successfully inserted.

So it seems that where I expect the function to return 2 it is now instead returning 0.

Has anyone verify this behaviour and what did you do about it?

mark_h
25th October 2006, 14:51
No I have not see this - we are moving 6.1c.07.11 and SP20 to production on weekend of Nov 3rd. I have not seen this problem. I will go run a couple where one where I know I use the change.view command and see if it has a problem.

So far the only problem I know that exists is ticst0101m000 gets an error on the first stpapi.put command. I logged a case with Baan. I know I can fix the problem if I remove form 2 from the session - I think it is corrupt in some way.

mark_h
25th October 2006, 15:04
I know the users did testing on most of my api code, but I thought I would double check. Below is part of the code to receive a production order - the stpapi.change.view had a return code of 1 - as I would expect.

stpapi.handle.subproc("tdilc4104s000","tdilc4515s000","add")
rc = stpapi.insert("tdilc4104s000",1,msg)
stpapi.put.field("tdilc4515s000","tdilc402.koor",str$(order.type))
stpapi.put.field("tdilc4515s000","tdilc402.orno",str$(order.number))
rc = stpapi.change.view("tdilc4515s000",msg)
if not isspace(msg) or rc<>1 then

Thomasm
25th October 2006, 15:09
Hello Mark and thank you for your reply.

I think your situation is a bit different from mine since you are receiving 1 from the function. I think my problem relates to receiving 0 where I used to get 2.

I can change the error handling functionality to not look at the return value but instead see if err.msg is empty or not. But if nothing else I thought to ask the question and give the warning.

Thanks,
/Thomas

mark_h
25th October 2006, 15:36
Sorry - did not catch that. I went out and reviewed all the code I could find and it seems that I never look for 2. I either look for a 1 or I just check the error message. Or sometimes both, but never do I look to see if it is 2.

günther
25th October 2006, 16:16
I had deep problems with change.view in another session (tdrpl0114m000). But in general I'm testing the values "found" against the values "expected". Maybe that is better than to trust any return values ;-) .

Günther