arthur_info
17th December 2009, 16:09
Hello all,
I'm trying to create routines in VB.net to automate the process of Purchase Request until Purchase Orders. The idea is to list in my program all the requests and after that, the user only put some essential fields data, such the best price, the best supplier and after that the system generate the Orders Purchase automatically. To do that I need enter data in the sessions tdcotd109m000, tdcotd201m000 and tdcotd211m000. Can somebody send me any sample?
Thanks in advance...
mark_h
17th December 2009, 18:28
I am not sure if you will find any examples for those sessions. You can try searching for user id al_smith - I believe he posted some examples of his vb code. Sorry I can not help, but in this forum are plenty of other example of sample AFS code. You can also search on excel to see other examples of vb code - I am not sure how relevant that is to vb.net.
arthur_info
17th December 2009, 19:35
Hello Mark,
Thanks for the answer. I'm trying to insert a new employee to feel more confortable with the commands. I was searching for any samples, but I found only some pieces and I'm not understanding how to make a complete code to insert a new employee. I'm making a code as below... Can you help me to complete this? Thanks in advance...
Dim BaanObj As Object
Dim B_function As String
BaanObj = CreateObject("Baan4.Application")
BaanObj.Timeout = 10
On Error GoTo BaanAutomationError
'Calling the session of Employees.
B_function = "zoom.to.menu(" & Chr(34) & "tccom0101m000" & Chr(34) & _
",2," & Chr(34) & Chr(34) & "," & Chr(34) & Chr(34) & ",0,0)"
BaanObj.ParseExecFunction("ottstpstandard", B_function)
'Here the screen appear... But...
'How to insert a new employee?
'And, if is possible, how to insert silently? Without showing any screen?
Exit Sub
BaanAutomationError:
MsgBox("Baan IV automation error: " & BaanObj.Error)
MsgBox("Return value function: " & B_function & " " & BaanObj.ReturnValue)
BaanObj.Quit()
BaanObj = Nothing
Exit Sub
mark_h
17th December 2009, 20:56
What you have posted will launch a session for manual input. There is two ways to do it silenty. The first menthod is you write AFS code(or libraries) in baan to perform the required action. Then in your VB code you call that baan function to pass the code. See this thread for some help (http://www.baanboard.com/baanboard/showthread.php?t=40288&highlight=excel).
The other method is to write everything in VB code. Let me see if I can find an example of this type code.
mark_h
17th December 2009, 21:41
Here is a thread with calls to ottstpapihand - http://www.baanboard.com/baanboard/showthread.php?t=56282&highlight=ottstpapihand.
Some of the things to search on are excel and ottstpapihand. A bunch of threads to search on how to accomplish some things.