gous99
7th January 2003, 18:28
Hi everybody,
I'm new to Baan5, I've done may scripts with AFS for baanIV but this is my first with BaanV.
Here is my question, when (manually) in the session Hours Accounting Transactions (tphrs1500m000) I want to add a new record, usually with AFS we put all fields and then call the insert function, but here when I'm in tphrs1500m000 and I click the New record button, it open session tphrs1100s000, so, while in tphrs1500m000, I dont have control over tphrs1100s000 yet, so how can I put my fields in tphrs1100s000 while in tphrs1500m000?
I'm a little confuse here.
mark_h
7th January 2003, 19:15
I have never used Baan V but I wonder if you need to use the stpapi.sync.dialog command. I pulled this example straight from the Baan documentation and maybe it fits your situation.
stpapi.put.field("dtfsa1501m000", "dtfsa101.seno", str$(i.seno))
ret = stpapi.find("dtfsa1501m000", error.msg)
if ret then
ret = stpapi.synchronize.dialog("dtfsa1501m000", "modify", error.msg)
if ret then
stpapi.put.field("dtfsa1101s000", "dtfsa101.name", new.name)
ret = stpapi.update("dtfsa1501m000", true, error.msg)
endif
endif
Mark
gous99
7th January 2003, 19:25
Thanks Mark,
But that would be good to update, but I want to insert new record in it, when you manually insert in BaanV, you just click the New button (equivalent of insert button in BaaIV), and the session tphrs1100s000 opens..... and that's where you create the new record...
mark_h
7th January 2003, 21:16
Actually I was thinking use stpapi.insert instead of stpapi.update. There are two or three more examples in the Baan documentation, but since I am not familiar with Baan V or these sessions I do not know which one might be the best - or if they even apply.
Maybe all you need is a stpapi.handle.subproc for the tphrs1100s000 session. Then when you do the stpapi.insert you would have control of the tphrs1100s000 session. Then you could do a normal stpapi.insert on it.
Just some guesses on things you could try.
Good Luck!
Mark
gous99
7th January 2003, 21:29
Where is that baan documentation that you are mentionning....
mark_h
7th January 2003, 21:53
The documentation is the very first post of this forum. The post is titled stpapi documentation. I am going attach a copy of what I have to that post. I do recommend contacting Baan for newer documentation.
Mark
mark_h
7th January 2003, 22:13
I am still trying to attach the documentation to this post (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=7251). For some reasons both Netscape and IE stop in the middle of the post. Eventually it will be there. :)
Mark