lli-baan
30th March 2005, 12:49
Hello,
we are using the API-Functioanlity quiet often!
Now we will use the API for the session timps4701m000 (rough capacty utilisation).
Unfortunately we can't find the APT-function for the "next.frm". With the next.frm the session normally calculate the capacity!
Does anybody now, how to use the API in ASCII-Session timps4701m000?
Thank u 4 your help!!!
RobertB
30th March 2005, 15:51
Hi,
Try creating an AFS-DLL for your session with ttstpcreatdll to see what wrapper functions are generated. These should give you a clue as to how to proceed.
HTH,
Rob
lli-baan
30th March 2005, 16:04
These are the "action"-functions in the AFS! We tried a few, but without the right result. Which one is the right one?
function extern void timpsf4701m000.end([string error(500)])
{
DLLUSAGE
Function to end connection to session timps4701m000
ENDDLLUSAGE
if get.argc() = 0 then
stpapi.end.session( "timps4701m000" )
else
error = get.string.arg(1)
stpapi.end.session( "timps4701m000" , error )
put.string.arg(1, error)
endif
}
function extern long timpsf4701m000.update( long do.update, ref string error )
{
DLLUSAGE
Function to update a record in session timps4701m000
Record must be made current and fields to be changed before calling
this function
ENDDLLUSAGE
return( stpapi.update( "timps4701m000", do.update, error ) )
}
function extern long timpsf4701m000.mark([string error (500)])
{
DLLUSAGE
Function to mark the current record in session timps4701m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.mark( "timps4701m000" ) )
else
error = get.string.arg(1)
ret = stpapi.mark( "timps4701m000" , error )
put.string.arg(1, error)
return( ret )
endif
}
function extern long timpsf4701m000.save( ref string error )
{
DLLUSAGE
Function to save an update/insert/delete in session timps4701m000
ENDDLLUSAGE
return( stpapi.save( "timps4701m000", error ) )
}
function extern long timpsf4701m000.find( [string error(500)] )
{
DLLUSAGE
Function to find a record in session timps4701m000
Search fields must be put before calling this function
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.find( "timps4701m000" ) )
else
error = get.string.arg(1)
ret = stpapi.find( "timps4701m000" , error )
put.string.arg(1, error)
return( ret )
endif
}
function extern void timpsf4701m000.clear( )
{
DLLUSAGE
Function to clear the current record in session timps4701m000
ENDDLLUSAGE
stpapi.clear( "timps4701m000" )
}
function extern void timpsf4701m000.set.report( const string reportname, const string device, ref string error )
{
DLLUSAGE
Function to set report name and device for a subsequent print action
in session timps4701m000
ENDDLLUSAGE
stpapi.set.report( "timps4701m000", reportname, device, error )
}
function extern long timpsf4701m000.next([string error(500)] )
{
DLLUSAGE
Function to find the next record in session timps4701m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.set( "timps4701m000", "next.set" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.set( "timps4701m000", "next.set" , error )
put.string.arg(1, error)
return( ret )
endif
}
function extern long timpsf4701m000.previous([string error(500)] )
{
DLLUSAGE
Function to find the previous record in session timps4701m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.set( "timps4701m000", "prev.set" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.set( "timps4701m000", "prev.set" , error )
put.string.arg(1, error)
return( ret )
endif
}
function extern long timpsf4701m000.set.view( [string error(500)] )
{
DLLUSAGE
Function to define another view in session timps4701m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.change.view( "timps4701m000" ) )
else
error = get.string.arg(1)
ret = stpapi.change.view( "timps4701m000", error )
put.string.arg(1, error)
return( ret )
endif
}
function extern long timpsf4701m000.first.view([string error(500)] )
{
DLLUSAGE
Function to read the first view in session timps4701m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.view( "timps4701m000" , "first.view" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.view( "timps4701m000", "first.view", error )
put.string.arg(1, error)
return( ret )
endif
}
function extern long timpsf4701m000.next.view([string error(500)] )
{
DLLUSAGE
Function to read the next view in session timps4701m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.view( "timps4701m000" , "next.view" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.view( "timps4701m000", "next.view", error )
put.string.arg(1, error)
return( ret )
endif
}
function extern long timpsf4701m000.previous.view([string error(500)] )
{
DLLUSAGE
Function to read the previous view in session timps4701m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.view( "timps4701m000" , "prev.view" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.view( "timps4701m000", "prev.view", error )
put.string.arg(1, error)
return( ret )
endif
}
function extern long timpsf4701m000.last.view([string error(500)] )
{
DLLUSAGE
Function to read the last view in session timps4701m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.view( "timps4701m000" , "last.view" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.view( "timps4701m000", "last.view", error )
put.string.arg(1, error)
return( ret )
endif
}
RobertB
30th March 2005, 16:24
OK,
I don't know this session, but reading the "Guidelines for Baan 4GL application sessions" in the "Developer's Guide for Application Server", I read thatIf the session has more than one form, keep the form commands (standard and specific) the same (across all forms- Rob). AFS does not have a notion of current form.So, AFS does not have any knowledge of which form a field is on.
HTH,
Robert
lli-baan
30th March 2005, 16:40
Thank u,
in this case it seems that it is not possible to start the session via API!
RobertB
30th March 2005, 16:50
Might i suggest that you move your code for calculating capacity from the form section of your script to a separate function, which you can then also call from a menu item or button.
This menu item or button can then be called via AFS.
HTH,
Servus, Robert