Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
18%
200 - 500 GB
29%
500 - 800 GB
3%
800 - 1200 GB
7%
1200 - 1500 GB
7%
1500 - 2000 GB
13%
> 2000 GB
22%
Total votes: 68

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 27th February 2019, 15:46
Krzysztof_PL Krzysztof_PL is offline
Junior Member
 
Join Date: Feb 2019
Posts: 5
Krzysztof_PL is on a distinguished road
Baan: 4 - DB: Oracle - OS: Windows
New record in session tfgld1101m000

Hi everyone,
I am using BaaN IV and I want to add a new record in the tfgld1101m000 session using ottstpapihand. I am a novice and have tried in all ways. Can someone write me an example of how I should do it?
Reply With Quote
  #2  
Old 27th February 2019, 16:56
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,258
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Search this forum for the session tfgld1101m000. There should be several examples around what people have done - here is one such thread http://www.baanboard.com/baanboard/s...=tfgld1101m000.
__________________
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
  #3  
Old 1st March 2019, 14:56
Krzysztof_PL Krzysztof_PL is offline
Junior Member
 
Join Date: Feb 2019
Posts: 5
Krzysztof_PL is on a distinguished road
Baan: 4 - DB: Oracle - OS: Windows
Thank you, Mark_h, for your answer. I added a new record in tfgld1101m000 and transactions. Now I want to enter the session tfcmg2100s000 and again I do not know how. I'm writing a program in C #. When I do it this way:
baanClass.ParseExecFunction("ottstpapihand", $"stpapi.handle.subproc(\"tfgld1101m000\", \"tfcmg2100s000\", \"add\")");
baanClass.ParseExecFunction("ottstpapihand", $"stpapi.continue.process(\"tfgld1101m000\", \"{errorString}\")");
The program hangs. What am I doing wrong?
Reply With Quote
  #4  
Old 11th March 2019, 02:29
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,258
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Look at this http://www.baanboard.com/baanboard/s...=tfcmg2100s000 thread. The first thing I usually try to do is search the AFS forum by the session a member is asking about.
__________________
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
  #5  
Old 19th March 2019, 15:31
Krzysztof_PL Krzysztof_PL is offline
Junior Member
 
Join Date: Feb 2019
Posts: 5
Krzysztof_PL is on a distinguished road
Baan: 4 - DB: Oracle - OS: Windows
Thank you, Mark.
I saw this post and this is a good way to do what I want, but ... I have the last step in my process to automate. From the tfcmg2100s000 session I have to go to the tfcmg2106s000 session and find one document there.
In the next step, I need to update rcpt field and click continue. Do you have any solution for this? How do you click the button?
Attached Images
File Type: jpg tfcmg2106s000.jpg (134.3 KB, 11 views)
Reply With Quote
  #6  
Old 19th March 2019, 22:52
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,258
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I might be missing something, but if you have control of the tfcmg2106s000 then all you need to do is stpapi.put of the data for the receipt and then stpapi.continue. So typically when you run thru the process in baan you just replicate(most cases) what happens with api code. So typically you start with a main session and control the subsessions from there. So you start with tfgld1101m000, it launchs tfcmg2100s000, then you click continue there and it launches tfcmg2106s000, update field and do a continue(or save). Then close sessions in reverse order. So I would have commands for tfgld1101m000, with stpapi.handle.subproc for tfmcg2100s000, then I would have commands for this session with a stpapi.handle subproc for tfcmg2106s000. Then as each subsession opens it typically has what you need like manually - you just put the information and do continue.
__________________
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
  #7  
Old 20th March 2019, 11:37
Krzysztof_PL Krzysztof_PL is offline
Junior Member
 
Join Date: Feb 2019
Posts: 5
Krzysztof_PL is on a distinguished road
Baan: 4 - DB: Oracle - OS: Windows
Now I'm trying to do it this way:
["stpapi.put.field(\"tfgld1101s000\",\"tfgld101.year\",\"2019\")",
"stpapi.put.field(\"tfgld1101s000\",\"tfgld101.btno\",\"59\")",
"stpapi.put.field(\"tfgld1101s000\",\"tfgld101.ttyp\",\"150\")",
"stpapi.find(\"tfgld1101s000\",\"\")",
"stpapi.handle.subproc(\"tfgld1101s000\",\"tfcmg2100s000\",\"add\")",
"stpapi.continue.process(\"tfgld1101s000\",\"\")",
"stpapi.put.field(\"tfcmg2100s000\",\"tfcmg204.ttyp\",\"150\")",
"stpapi.put.field(\"tfcmg2100s000\",\"tfcmg204.tran\",\"3\")",
"stpapi.put.field(\"tfcmg2100s000\",\"tfcmg204.ccur\",\"EUR\")",
"stpapi.put.field(\"tfcmg2100s000\",\"tfcmg204.suno\",\"113839\")",
"stpapi.put.field(\"tfcmg2100s000\",\"tfcmg204.amnt\",\"182,90\")",
"stpapi.insert(\"tfcmg2100s000\",1,\"\")",
"stpapi.handle.subproc(\"tfcmg2100s000\",\"tfcmg2106s000\",\"add\")",
"stpapi.continue.process(\"tfcmg2100s000\",\"\")",
"stpapi.put.field(\"tfcmg2106s000\",\"tfacp200.ttyp\",\"411\")",
"stpapi.put.field(\"tfcmg2106s000\",\"tfacp200.ninv\",\"60046151\")",
"stpapi.change.view(\"tfcmg2106s000\",\"\")",
"stpapi.put.field(\"tfcmg2106s000\",\"tfacp200.rcpt\",\"1\")",
"stpapi.update(\"tfcmg2106s000\",1,\"\")",
"stpapi.end.session(\"tfcmg2106s000\")",
"stpapi.end.session(\"tfcmg2100s000\")",
"stpapi.end.session(\"tfgld1101s000\")"]

It creates something like that (pic1), and it should be something like that(pic2)
Attached Images
File Type: jpg pic1.jpg (15.4 KB, 4 views)
File Type: jpg pic2.jpg (13.0 KB, 4 views)
Reply With Quote
Sponsored Links
  #8  
Old 20th March 2019, 17:04
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,258
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Quote:
Originally Posted by Krzysztof_PL View Post
"stpapi.continue.process(\"tfcmg2100s000\",\"\")",
"stpapi.put.field(\"tfcmg2106s000\",\"tfacp200.ttyp\",\"411\")",
"stpapi.put.field(\"tfcmg2106s000\",\"tfacp200.ninv\",\"60046151\")",
"stpapi.change.view(\"tfcmg2106s000\",\"\")",
"stpapi.put.field(\"tfcmg2106s000\",\"tfacp200.rcpt\",\"1\")",
"stpapi.update(\"tfcmg2106s000\",1,\"\")",
"stpapi.end.session(\"tfcmg2106s000\")",
"stpapi.end.session(\"tfcmg2100s000\")",
"stpapi.end.session(\"tfgld1101s000\")"]
If I was doing this in a baan session, I would start debugging in the above spot. After the continue on tfcmg2100s000 I would make sure that 2106s000 was controlled by the parent ID of tfcmg2100m000. I could do this thru option dialog/start shell on my baan login. If that worked I would then put a couple of get fields for tfacp200.ttyp and tfacp200.ninv. Assuming the change.view returned a 1 - view found. If it returned 0 or 2 there might be an issue. I would also check to see if in tfcmg2106s000 if the button pointed to update or continue.

Keep in mind we do not use these sessions like this, so what starts when and how I am not sure of.
__________________
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
  #9  
Old 22nd March 2019, 13:33
Krzysztof_PL Krzysztof_PL is offline
Junior Member
 
Join Date: Feb 2019
Posts: 5
Krzysztof_PL is on a distinguished road
Baan: 4 - DB: Oracle - OS: Windows
Mark, I got the source code for the session. Can I use stpapi.form.command in BaaN IV? stpapi.form.command returns -2. Do you know what that means?
Now I'm trying something like:
stpapi.handle.subproc(\"tfcmg2100s000\",\"tfcmg2106s000\",\"add\")
stpapi.continue.process(\"tfcmg2100s000\",\"\")
stpapi.put.field(\"tfcmg2106s000\",\"tfacp200.ttyp\",\"411\")
stpapi.put.field(\"tfcmg2106s000\",\"tfacp200.ninv\",\"60046346\")
stpapi.put.field(\"tfcmg2106s000\",\"tfacp200.line\",\"0\")
stpapi.find(\"tfcmg2106s000\",\"\") -- return 1
stpapi.put.field(\"tfcmg2106s000\",\"tfacp200.rcpt\",\"1\")
stpapi.form.command(\"tfcmg2106s000\", \"5\", \"write.fields.to.tb\", \"\")
Reply With Quote
  #10  
Old 25th March 2019, 12:18
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,258
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Stpapi.form.command based off the documentation does not return a value. I would expect that last field to be something with an error message in it.

void stpapi.form.command(string session, long command.type, string command.prog, ref string err.mesg)
__________________
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
zoom to session and find record automatically timb25 Tools Development 11 25th April 2012 22:21
View field of display session keeps resetting value to first record in table!!?? en@frrom Tools Development 2 25th August 2006 15:26
Need help getting selected record in subsession tab0529 Tools Development 6 21st May 2003 17:01
tfacp9450m000 FIBU Brush Up Kai's Forum Users Deutsches Forum 1 16th November 1999 00:00


All times are GMT +2. The time now is 19:32.


©2001-2018 - Baanboard.com - Baanforums.com