mekawy
20th June 2010, 11:35
what is the parameters of this function stpapi.put.field("","", , )
it has 3 parameters can anyone tell me what exactly should be written in each parameter, thanks
king1980
20th June 2010, 11:52
Hi Mekaway,
in the stpapi.put.field function require 3 parameters
1) Session name
2) Table Field Name
3) Field Value
e.g:
stpapi.put.field("whinh4525m000", "whinh225.oorg", str$(etol(whpcl012.oorg)))
Regards
king1980
mekawy
21st June 2010, 11:00
thanks king
but when i insert the values, the sessions don't be affected with the values i entered
can u plz tell me how 2 write script 2 insert a value in a session
vee_naresh
21st June 2010, 12:59
SYNTAX
void stpapi.put.field(string session, string field, string value, [long element])
ARGUMENTS
session Name of the session this command is executed on.
field Name of the field whose value is desired.
value The value of the field specified in field is set to the contents of this parameter. Any necessary type conversion is performed
element Array element whose value is to set returned in the case of arrays or repeating fields.
Regards,
Naresh V
manish_patel
21st June 2010, 13:15
At high level; to insert a record you have to do following
stpapi.put.field() : Sets the current value of a particular field in a specified running Baan session
stpapi.insert() : Insert Record in session
stpapi.save() : Save Session Updates to database
Please check AFS related document (http://www.baanboard.com/baanboard/showthread.php?t=7251) in Threads in Forum: AFS/DDC/OLE: Function servers.
mark_h
21st June 2010, 16:02
This is the correct forum for this issue. You can search this forum for plenty of examples of posted sample code.
mekawy
22nd June 2010, 17:17
I created a new session with name tcmcs0145m099 it supposed to insert a new record in the area session (tcmcs0145m000) that has 2 fields ( tcmcs045.cerg & tcmcs045.dsca ). plz what is the exact code to do that thanks in advance
mark_h
22nd June 2010, 20:23
This is some sample code I found. No error checking. You can look at the first thread of this forum for command syntax. You can also search on this forum for the session in question.
stpapi.put.field("tcmcs0145m000","tcmcs045.creq","WPA")
stpapi.put.field("tcmcs0145m000","tcmcs045.dsca","Some Description")
stpapi.insert("tcmcs0145m000", 1,err)
stpapi.end.session("tcmcs0145m000")
mekawy
27th June 2010, 09:43
thanks but what is the parameters of this function stpapi.save();
manish said that it Saves the Session Updates to database cause my actions not affects the database at all :(
mekawy
27th June 2010, 10:33
and plz anyone can tell me if there is a problem 2 insert a new record in the Area Session ???????????????
mark_h
28th June 2010, 01:07
(1) Look at the sticky thread on this forum for stpapi documention. That will show you the parameters.
(2) I provided code that insets a new record. It works just fine for me.
mekawy
29th June 2010, 10:22
is there any layer of software required to run a script to write from session to another session as running service ,setup another software , running tools session to support this action. as far the script code is ok?
mark_h
29th June 2010, 15:13
I am not sure I understand that last question - if you write a baan session to run in the background another baan session there is not any other software needed. On my 4c4 when I kick off a stpapi type session there is stpapiserv type process in the background. The only thing I can think of that needs to be setup for this would be to grant the session user access to both the api program and the session called by the api program. So I am not exactly sure what you are asking.