spartacus
20th January 2003, 18:13
We are trying control a session with AFS.
In this session is a lot of logic in field sections, esp. "when.field.changes". Now we fear, that the program, if controled from AFS passes none of the field sections. We also tried "seq.puts()" to be sure, that the field sections will be not passed.
The problem is, that this sections provide a lot of important logic for the program.
Does sombody have similar experiences?
Thanks
Spartacus
lbencic
20th January 2003, 20:02
The AFS should call all field sections for any field passed, in the same order as the session would. You can see this in the debugger. For Baan V, it also automatically calls the DAL's, as the session would.
The problem can come in the order of calling, it is in the natural data entry order, not the order you may send it in. So, some fields may be overwritten that you may not be expecting, because some entry into another field will overwrite. This does not eliminate the calling of sections however.
If you find it is not passing the proper values to the AFS, you may need a patch update to the AFS library, I had that problem once with a fairly recent version of the AFS, but on Baan IV.
What makes you think it's not calling the when.field.changes section? Have you debugged?
spartacus
21st January 2003, 09:47
Hi Ibencic,
thanks u give us something to check.
We found that the field sections/subsections are not passed, because we filled in a little "seq.puts()" to write debugging infos.
On the other hand we found, that the debugger stops in the called session only the first time, we send something to the called sesssion. Then the debugger stops in "before.programm", and returns after the "before.program" section. Then the debugger stops never more in the called process (if we put data, or send an update). But we can see with our seq.puts, that certain program sections are passed, but none of the field sections.
Greetings
Spartacus
lbencic
21st January 2003, 17:10
Well, in debug you would see the Before program section (and init forms / other startup sections) happen on the very first field puts. At that time, you would not see the field sections, and that may seem odd. The actual field put is not done yet, just the session activated. Each following puts that you do get's held and not send to the called object until the update (insert/update/delete) command is issued. At that time, you should see all of the field sections, then the related insert/update/delete sections.
If this is not happening as above then your afs library is not working right. You put breaks in the field sections and they are never hit? I'm not sure, maybe post your code, but if this is true you would need to check with Baan about your object. As mentioned, in Baan IV I had an issue with a new version of the api library (somewhere in the middle of SP9), and had to go back to an older version of the library.
If you are getting nowhere, post the script (and/or dump of the session would be convienent) and I will try to debug and see if the same is happening here..what version of ERP / Service Pack / Porting set are you on...and can you check the idents of your ttstpapihandle library and post as well? Seems like a problem with the library.
dawohuhu
21st January 2003, 17:49
I Ibencic,
thanks for your offer.
During this day we went a little futher, but also back again.
Looks a though, that we have had a syntax error with:
f2500m000.synchronize.dialog("Add", error). We are still not sure if we should write "Add", or "add".
We did a lot of things today, but now we reached a state again, that we can say, that the fields in the called session are not filled properly. Impossible to write the whole story of the day.
What we do, is trying to add a record in whinh2100s000 via whinh2500m000 (ERP).
For the first I can attach our dll-script, the afs.log fileand the ID's of our "otstpapihand".
Perhaps u will have any idea. Hope informaton is enough.
Spartacus
lbencic
21st January 2003, 18:01
Not getting filled properly and not calling the field sections are 2 separate issues. As mentioned, the afs's will sometimes overwrite your values when you do not expect, or your field is not available for input when the session tries. They are not always easy to work with.
Do you know, is it still a problem with not calling the field sections at all, or is it a logic problem that it is overwriting or not placing the values in specific fields....
It does seem like there is a conceptual problem - the put fields are not acted upon until the insert command is issued. If you use the get commands right after the put commands (anytime before the insert), you will not get the expected result, and may not think the fields are not being passed.
What does the error message show?
spartacus
22nd January 2003, 11:56
Hi Ibencic,
forgett the problem, with the fieldsections. That seems to work. In fact we have such a strange behavior, that it's hardly to describe, what the problem is.
At the moment we are discussing the correct syntax of:
"f2500m000.synchronize.dialog("add", error)"
We are not sure, do we have to write "Add" or "add". At the moment we prefer "add".
Both versions run with differnent error messages. That is, that we are missing always some other values in our target, to successfully run this session. We have no error on system level, we have the problem, that SOME variables are not correctly filled in the target.
At the moment (with "add" version) we found (with our seq.puts()" that at the very beginning of the program in "before.display.object" section the right values are present. At that moment the update.status is "0".
Interessting: with our seq.puts(...) we found that at this time (when the right values are present), we havn't had sent any "..put.." of a value to the target session.
Later , this values disapear, an never come up again. Some other field values we fill seem to be right.
Perhaps the attachment is able to explain the situation little better. This is the file we wrote with our "seq.puts()"
Spartacus
spartacus
22nd January 2003, 15:11
IT WORKS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Our poblem was, that we have two segemented item fields in the form. We found also here in the baanboard, that it is not possible to put segemented item fields at once.
Due to the fact, that Baan, with the start of the session shows the last values filled in, we thougt, that we have had success with our put. But at least, we found out, that our values never reached their destination.
Thanks for your support
Spartacus
Paul P
23rd January 2003, 03:32
Dear spartacus,
I sympathise with you, dude. I had to go to such a tiring problem before with stpapi.synchronize.dialog() (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=7361). We wouldn't have to go through both of our problem if the 2 aspects we were going through are mentioned in the manual. The item segmentation problem will be taken care of if you use the API DLL created by latest STP by the way.
Rgds,
Paul