Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
15%
200 - 500 GB
27%
500 - 800 GB
4%
800 - 1200 GB
4%
1200 - 1500 GB
12%
1500 - 2000 GB
15%
> 2000 GB
23%
Total votes: 26

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 10th October 2018, 11:02
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 225
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
How to create an AFS

Hi,

Can anybody explain how to create an new AFS please?
Thanks in Advance...
Regards,
Pralash
Reply With Quote
  #2  
Old 10th October 2018, 11:30
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 605
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Creating AFS DLL of a session

Hi Pralash,

In Baan IV, go to File->Run, then in the run dialogue box provide ttstpcreatdll as session name.

It will open a session where you can provide the session name for which you want to create dll (AFS). See attached screen shot for ref. I think process is same for Infor Ln.

After following the above steps, you can open Libraries session to view dll (in this case, tcmcsf0123m000).

Hope this helps.
Vishal
Attached Images
File Type: jpg creating_afs_dll.jpg (57.7 KB, 16 views)

Last edited by VishalMistry : 10th October 2018 at 12:34.
Reply With Quote
Sponsored Links
  #3  
Old 10th October 2018, 14:33
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 225
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Hi Vishal Mistry,

Thanks a lot for your guidance... As you suggested, I've created an AFS...
Regards,
Pralash
Reply With Quote
  #4  
Old 10th October 2018, 15:06
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 225
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Hi Vishalmistry,
As you suggested, I've created the following AFS for a particular session...
But I got an error while compiling the AFS. Please advise me that what is the exact issue by referring the attachment...
Thanks in advance,
Regards,
Pralash
|------------------------------------------------------------------------------
| File created by ttstpcreatdll, Date: 03/10/18
| Created for session: tcemp1503m000
|------------------------------------------------------------------------------

#pragma used dll ottstpapihand

function extern void tcempf1503m000.put.Roll_No( const domain tcncmp value )
{
DLLUSAGE
Function to set Roll No ( tcemp103.roll ) in session tcemp1503m000
arg: - value to put in Roll No
ENDDLLUSAGE
stpapi.put.field( "tcemp1503m000", "tcemp103.roll", str$(value) )
}

function extern domain tcncmp tcempf1503m000.get.Roll_No( )
{
DLLUSAGE
Function to get Roll No ( tcemp103.roll ) from session tcemp1503m000
return: - value of Roll No
ENDDLLUSAGE
string value(5)
stpapi.get.field( "tcemp1503m000", "tcemp103.roll", "1000" )
return( lval(value) )
}

function extern void tcempf1503m000.put.Mark_1( const domain tcncmp value )
{
DLLUSAGE
Function to set Mark 1 ( tcemp103.mar1 ) in session tcemp1503m000
arg: - value to put in Mark 1
ENDDLLUSAGE
stpapi.put.field( "tcemp1503m000", "tcemp103.mar1", str$(value) )
}

function extern domain tcncmp tcempf1503m000.get.Mark_1( )
{
DLLUSAGE
Function to get Mark 1 ( tcemp103.mar1 ) from session tcemp1503m000
return: - value of Mark 1
ENDDLLUSAGE
string value(5)
stpapi.get.field( "tcemp1503m000", "tcemp103.mar1", "200")
return( lval(value) )
}

function extern void tcempf1503m000.put.Mark_2( const domain tcncmp value )
{
DLLUSAGE
Function to set Mark 2 ( tcemp103.mar2 ) in session tcemp1503m000
arg: - value to put in Mark 2
ENDDLLUSAGE
stpapi.put.field( "tcemp1503m000", "tcemp103.mar2", str$(value) )
}

function extern domain tcncmp tcempf1503m000.get.Mark_2( )
{
DLLUSAGE
Function to get Mark 2 ( tcemp103.mar2 ) from session tcemp1503m000
return: - value of Mark 2
ENDDLLUSAGE
string value(5)
stpapi.get.field( "tcemp1503m000", "tcemp103.mar2", "300" )
return( lval(value) )
}

function extern void tcempf1503m000.put.Mark_3( const domain tcncmp value )
{
DLLUSAGE
Function to set Mark 3 ( tcemp103.mar3 ) in session tcemp1503m000
arg: - value to put in Mark 3
ENDDLLUSAGE
stpapi.put.field( "tcemp1503m000", "tcemp103.mar3", str$(value) )
}

function extern domain tcncmp tcempf1503m000.get.Mark_3( )
{
DLLUSAGE
Function to get Mark 3 ( tcemp103.mar3 ) from session tcemp1503m000
return: - value of Mark 3
ENDDLLUSAGE
string value(5)
stpapi.get.field( "tcemp1503m000", "tcemp103.mar3", "400" )
return( lval(value) )
}

function extern void tcempf1503m000.put.Total( const domain tcncmp value )
{
DLLUSAGE
Function to set Total ( tcemp103.tota ) in session tcemp1503m000
arg: - value to put in Total
ENDDLLUSAGE
stpapi.put.field( "tcemp1503m000", "tcemp103.tota", str$(value) )
}

function extern domain tcncmp tcempf1503m000.get.Total( )
{
DLLUSAGE
Function to get Total ( tcemp103.tota ) from session tcemp1503m000
return: - value of Total
ENDDLLUSAGE
string value(5)
stpapi.get.field( "tcemp1503m000", "tcemp103.tota", "900" )
return( lval(value) )
}

function extern void tcempf1503m000.end([string error(500)])
{
DLLUSAGE
Function to end connection to session tcemp1503m000
ENDDLLUSAGE
if get.argc() = 0 then
stpapi.end.session( "tcemp1503m000" )
else
error = get.string.arg(1)
stpapi.end.session( "tcemp1503m000" , error )
put.string.arg(1, error)
endif
}

function extern long tcempf1503m000.insert( long do.update, ref string error )
{
DLLUSAGE
Function to insert a record in session tcemp1503m000
Fields must be put before calling this function
ENDDLLUSAGE
return( stpapi.insert( "tcemp1503m000", do.update, error ) )
}

function extern long tcempf1503m000.update( long do.update, ref string error )
{
DLLUSAGE
Function to update a record in session tcemp1503m000
Record must be made current and fields to be changed before calling
this function
ENDDLLUSAGE
return( stpapi.update( "tcemp1503m000", do.update, error ) )
}

function extern long tcempf1503m000.delete( long do.update, ref string error )
{
DLLUSAGE
Function to delete a record in session tcemp1503m000
Record must be made current before calling this function
ENDDLLUSAGE
return( stpapi.delete( "tcemp1503m000", do.update, error ) )
}

function extern long tcempf1503m000.mark([string error (500)])
{
DLLUSAGE
Function to mark the current record in session tcemp1503m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.mark( "tcemp1503m000" ) )
else
error = get.string.arg(1)
ret = stpapi.mark( "tcemp1503m000" , error )
put.string.arg(1, error)
return( ret )
endif
}

function extern long tcempf1503m000.recover( ref string error )
{
DLLUSAGE
Function to undo an update/insert/delete in session tcemp1503m000
ENDDLLUSAGE
return( stpapi.recover( "tcemp1503m000", error ) )
}

function extern long tcempf1503m000.save( ref string error )
{
DLLUSAGE
Function to save an update/insert/delete in session tcemp1503m000
ENDDLLUSAGE
return( stpapi.save( "tcemp1503m000", error ) )
}

function extern long tcempf1503m000.find( [string error(500)] )
{
DLLUSAGE
Function to find a record in session tcemp1503m000
Search fields must be put before calling this function
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.find( "tcemp1503m000" ) )
else
error = get.string.arg(1)
ret = stpapi.find( "tcemp1503m000" , error )
put.string.arg(1, error)
return( ret )
endif
}

function extern long tcempf1503m000.synchronize.dialog( string mode(8), ref string err.mesg)
{
DLLUSAGE
Function to set up a synchronized dialog between multi-occurrence
and single-occurrence session
ENDDLLUSAGE
return( stpapi.synchronize.dialog("tcemp1503m000", mode , err.mesg) )
}

function extern void tcempf1503m000.clear( )
{
DLLUSAGE
Function to clear the current record in session tcemp1503m000
ENDDLLUSAGE
stpapi.clear( "tcemp1503m000" )
}

function extern void tcempf1503m000.print( ref string error )
{
DLLUSAGE
Function to start the print option in session tcemp1503m000
ENDDLLUSAGE
stpapi.print.report( "tcemp1503m000", error )
}

function extern void tcempf1503m000.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 tcemp1503m000
ENDDLLUSAGE
stpapi.set.report( "tcemp1503m000", reportname, device, error )
}

function extern long tcempf1503m000.first([string error(500)] )
{
DLLUSAGE
Function to find the first record in session tcemp1503m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.set( "tcemp1503m000", "first.set" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.set( "tcemp1503m000", "first.set" , error )
put.string.arg(1, error)
return( ret )
endif
}

function extern long tcempf1503m000.next([string error(500)] )
{
DLLUSAGE
Function to find the next record in session tcemp1503m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.set( "tcemp1503m000", "next.set" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.set( "tcemp1503m000", "next.set" , error )
put.string.arg(1, error)
return( ret )
endif
}

function extern long tcempf1503m000.previous([string error(500)] )
{
DLLUSAGE
Function to find the previous record in session tcemp1503m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.set( "tcemp1503m000", "prev.set" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.set( "tcemp1503m000", "prev.set" , error )
put.string.arg(1, error)
return( ret )
endif
}

function extern long tcempf1503m000.last([string error(500)] )
{
DLLUSAGE
Function to find the last record in session tcemp1503m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.set( "tcemp1503m000", "last.set" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.set( "tcemp1503m000", "last.set" , error )
put.string.arg(1, error)
return( ret )
endif
}

function extern long tcempf1503m000.set.view( [string error(500)] )
{
DLLUSAGE
Function to define another view in session tcemp1503m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.change.view( "tcemp1503m000" ) )
else
error = get.string.arg(1)
ret = stpapi.change.view( "tcemp1503m000", error )
put.string.arg(1, error)
return( ret )
endif
}

function extern long tcempf1503m000.first.view([string error(500)] )
{
DLLUSAGE
Function to read the first view in session tcemp1503m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.view( "tcemp1503m000" , "first.view" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.view( "tcemp1503m000", "first.view", error )
put.string.arg(1, error)
return( ret )
endif
}

function extern long tcempf1503m000.next.view([string error(500)] )
{
DLLUSAGE
Function to read the next view in session tcemp1503m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.view( "tcemp1503m000" , "next.view" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.view( "tcemp1503m000", "next.view", error )
put.string.arg(1, error)
return( ret )
endif
}

function extern long tcempf1503m000.previous.view([string error(500)] )
{
DLLUSAGE
Function to read the previous view in session tcemp1503m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.view( "tcemp1503m000" , "prev.view" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.view( "tcemp1503m000", "prev.view", error )
put.string.arg(1, error)
return( ret )
endif
}

function extern long tcempf1503m000.last.view([string error(500)] )
{
DLLUSAGE
Function to read the last view in session tcemp1503m000
ENDDLLUSAGE
long ret
if get.argc() = 0 then
return( stpapi.browse.view( "tcemp1503m000" , "last.view" ) )
else
error = get.string.arg(1)
ret = stpapi.browse.view( "tcemp1503m000", "last.view", error )
put.string.arg(1, error)
return( ret )
endif
}

function extern string tcempf1503m000.get.last.message.code([string error(500)])
{
DLLUSAGE
Function to get the code of the message which occurred on
the last insert/update/delete/save/recover action in session tcemp1503m000
ENDDLLUSAGE
string ret(20)
if get.argc() = 0 then
return( stpapi.get.mess.code( "tcemp1503m000" ) )
else
error = get.string.arg(1)
ret = stpapi.get.mess.code( "tcemp1503m000", error )
put.string.arg(1, error)
return( ret )
endif
}

function extern string tcempf1503m000.get.last.error( )
{
DLLUSAGE
Function to get the error message which occurred on
the last action in the Function Server
ENDDLLUSAGE
return( stpapi.get.error( ) )
}

function extern void tcempf1503m000.handle.sub.process( const string sub.process, const string action )
{
DLLUSAGE
Function to define an action when a sub process is started.
Possible actions are: add/send/ignore/kill
add - add child session to internal structure,
session dll of child can be used
send - send all api calls to child instead of parent
ignore - child process is ignored, parent will wait
until child exits (for background processes)
kill - child process is killed immediately
ENDDLLUSAGE
stpapi.handle.subproc( "tcemp1503m000", sub.process, action )
}

function extern void tcempf1503m000.define.enum.answer( const string question, bset answer )
{
DLLUSAGE
Function to define an answer on a question, when the default answer should not be taken.
ENDDLLUSAGE
stpapi.enum.answer( "tcemp1503m000", question, answer )
}
Attached Images
File Type: png AFS.png (19.0 KB, 9 views)
Reply With Quote
  #5  
Old 11th October 2018, 08:33
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 605
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Wink sample dll for session tcmcs0123m000

Hello Pralash,

Looking at one of the get function in your attached code:
function extern domain tcncmp tcempf1503m000.get.Roll_No( )
{
DLLUSAGE
Function to get Roll No ( tcemp103.roll ) from session tcemp1503m000
return: - value of Roll No
ENDDLLUSAGE
string value(5)
stpapi.get.field( "tcemp1503m000", "tcemp103.roll", "1000" )
return( lval(value) )
}

The third argument should not be a string constant but a variable as given in the attached AFS DLL for session tcmcs0123m000.
Please replace below statement:
stpapi.get.field( "tcemp1503m000", "tcemp103.roll", "1000" )
with
stpapi.get.field( "tcemp1503m000", "tcemp103.roll", value ) as the function is returning the value of variable "value". Make this change is every get function and it should resolve the issue.

Vishal
Attached Files
File Type: cln sample_afs_for_tcmcs0123m000.cln (11.1 KB, 8 views)
Reply With Quote
  #6  
Old 11th October 2018, 14:08
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 225
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Hi Vishalmistry,

As per your ideas, I resolved the issue and successfully compiled the AFS. But I don't know that how to execute this AFS. Hence pls let me know that how to execute the AFS...

Thanks in advance,
Pralash
Reply With Quote
  #7  
Old 11th October 2018, 17:01
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,134
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
There is documentation pinned to the top of this forum where I moved this post. It is http://www.baanboard.com/baanboard/s...ead.php?t=7251 this post.

So far it looks like all you did was create a library with calls to a session. Now you actually create a new session to call the library to drive the standard baan session. I used to create libraries with ttstpcreate, but no longer do. You might try searching on you session in question to see if someone else has posted code. If you do not find it there are plenty of other examples of what people have to done. Basically a lot of times I take an input file, upload it to the server, process the data using AFS code and generate a report. So poke around and read some in this forum to get started.
__________________
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
  #8  
Old 11th October 2018, 17:13
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 225
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Hi Mark,

Thank so much for your guidance... I will go through the document...

Regards,
Pralash
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
Use AFS to create a patch file. Ruskin AFS/DDC/OLE: Function servers 4 24th December 2013 12:22
Use Afs to Create Sales Order and Sales Order Lines JerryMaWang AFS/DDC/OLE: Function servers 2 1st June 2011 23:12
Please Urgent Help me AFS for create Purchase Order Baan V cte sistemas AFS/DDC/OLE: Function servers 1 16th February 2010 02:28
Steps to create AFS indian_sumesh AFS/DDC/OLE: Function servers 1 6th November 2008 18:32
Try to create AFS for session ttadv6420m000 gous99 AFS/DDC/OLE: Function servers 6 9th January 2003 19:27


All times are GMT +2. The time now is 06:39.


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