francis
16th March 2006, 18:07
Try to do a change and update the forecast and extra demand via AFS but with no luck so far. Process seems completed successfully but no record gets updated as desired. No error message whatsoever and AFS.LOG steps all indicated success. All ret of api function call = 1.
stpapi.put.field("timps3101m000","tipms300.plnc",timps930.plnc)
stpapi.put.field("timps3101m000","tipms300.plvl",str$(timps930.plvl))
stpapi.put.field("timps3101m000","tipms300.plni",timps930.plni)
stpapi.put.field("timps3101m000","tipms300.pdat",str$(timps930.pdat(i)))
ret = stpapi.find("timps3101m000",err.msg)
stpapi.put.field("timps3101m000","tipms300.demf",str$(timps930.dfbq(i)))
ret = stpapi.update("timps3101m000",true,err.msg)
Do the follow for debugging and found all fields are empty.
stpapi.get.field("timps3101m000","tipms300.plnc",plan.code)
stpapi.get.field("timps3101m000","tipms300.plvl",plan.level)
stpapi.get.field("timps3101m000","tipms300.plni",plan.item)
stpapi.get.field("timps3101m000","tipms300.demf",plan.demf)
Don't have a clue. any one can help please ?
mark_h
16th March 2006, 20:31
Have you tried stpapi.change.view instead of find? It may look like the find is working when it really isn't. You might want to move your get fields to right after the find(or change view). Make sure they return information first. Do you have the source for timps3101m000? Putting it in debug mode would help figure out where the problem is.
francis
16th March 2006, 21:15
Thanks for coming back so quickly. Actually I have tried what you suggest here and it doesn't change anything.
timps3101m000 has form 3 + view. Experimenting the user action on the form. Using "stpapi.find" I get the exact record, using "stpapi.hange.view" I get the first record of the set instead which I don't want. In both case, Baan documentation says the record is automatically treated as current which I have doubt.
Yes the stpapi.get is put after the find/change.view. I don't have source code.
In afs.log, it shows the "Record is found", but when I try to get the record, it retunrs all empty fields. So the issue is how do I tell the subsequent api call recognizes the record is current?
Thanks and regards.
mark_h
16th March 2006, 23:18
A couple of things to try:
(1) stpapi.clear as the first call to the session.
(2) I can't find it right now, but I had one session start in modify mode and before I could do anything I had to do stpapi.save to get it out of modify mode. You might want to try doing the find, doing a save, then doing the find again. The save should not hurt anything. I really think this might be the problem - start mode of modify. At least that is how this session is set-up on our system.
mark_h
16th March 2006, 23:27
OOps just realized I looked at the wrong session for the start option. What the heck - would not hurt to try what I suggested anyway. You might also try a stpapi.mark on the record.
francis
21st March 2006, 22:22
BaaN programmed the behaviours of the session forms + the selection of record when session starts up (it's either the first record after date.num() of the first view or the first record after date.num() of the view last used by logname$) all api find, browse and view actions are not working at all. You can see the result of the 4 parts of the key fields by doing a get.field in the api script. try changing the start option of teh session but it doesn't help either. Any one gets any idea to this one. Thanks in anticipation.
The session is not operable from api, can I log a case to BaaN Support? Do you think they should make it work?
lbencic
21st March 2006, 22:59
Baan support has a list of the sessions they DO support for API's, so, it's the other way around. Not all sessions are supported, and unless it's on their list they are not obligated to make it work. Looking at the code for timps3101, I see tons of automatic updates (execute(update.db)), and automatic form changes (to.form(2), etc). These commands mess with the API calls, so I doubt that session is supported. That said, I tried to search the site and could not find the list, sorry, maybe someone else knows where it is.
mark_h
22nd March 2006, 15:32
You can always log a case, but they may not fix it. A couple of times they tried for me, but eventually came back and said it was not supported. I am attaching the last list I have from Baan - it is old.
Can you create manipulate things to find your record? Can you do a change.view and then just keep skipping records until you find the correct record? We do not use this session, so I can not think of any work arounds.