Run 4GL code from vb.net app

Cheers. I will give it a go.

Ross



On 30 Jun 2011, at 12:13, "Mike Anstey" <manstey@...> wrote:

> Haven't actually tried it, but here is some code I got a while back:
>
> Hi Mike
>
> I'm not entirely sure as I don't have an example to hand, but I'd guess
> at....
>
> parms.setStringParameter(6, errorFile, ParameterSet.OUTPUT)
>
> or
>
> parms.setStringParameter(6, errorFile, ParameterSet.INPUT_OUTPUT)
>
> ...then after runPersistentProcedure...
>
> Object o = parms.getOutputParameter(6)
>
> or
>
> Object o = parms.getParameterInOut(6)
>
> where 6 is the index of the output param in parms.
>
> Or if it's a procedure return value...
>
> Object o = parms.ProcedureReturnValue()
>
> Cheers
>
> Trev
>
> From: Mike Anstey [mailto:manstey@...]
> Sent: 19 January 2010 15:02
> To: Trevor Negus
> Subject: FW: Calling .p
>
> Hello Trevor, when calling a .p, how would you reference an output value
> from the .p? e.g. you want the program to return something you can then
> use as a variable in the screen.
>
> ________________________________
>
> From: Anthony Knight [mailto:AKnight@...]
> Sent: Thursday, December 03, 2009 1:47 PM
> To: Mike Anstey
> Cc: Trevor Negus
> Subject: FW: Calling .p
>
> Thanks Trev ;)
>
> Once FB sign a WA, please feel free to send him any examples he requests
> which we have "to hand" . If we need to create one, let him know how
> long that will take and if he agrees, go for it ;)
>
> Ant
>
> From: Trevor Negus
> Sent: 03 December 2009 16:38
> To: Anthony Knight
> Subject: Calling .p
>
> ' Call a Progress procedure directly
>
> ' You need to include custom references to:
>
> ' Progress.o4glrt.dll
>
> ' Epicor.Mfg.AD.SysAgent.dll
>
> ' also the following imports:
>
> ' Imports Epicor.Mfg.Core
>
> ' Imports Progress.Open4GL.DynamicAPI
>
> ' then something like the following should work within your button click
>
> ' you'll see the last thing this does is call a refresh.
>
> Dim ThisSession As Epicor.Mfg.Core.Session = GLJournalEntryForm.Session
>
> Dim ThisProgressSession As Progress.Open4GL.DynamicAPI.Session
>
> Dim ThisPersistentProc As PersistentProc
>
> Try
>
> ThisProgressSession = ThisSession.ConnectionPool.Get()
>
> Dim parms As ParameterSet = New ParameterSet(6)
>
> '1 = group
>
> '2 = DfltDept
>
> '3 = DfltDiv
>
> '4 = DfltChart
>
> '5 = import
>
> '6 = errlog
>
> ' Save these so can set back (after screen gets "refreshed")
>
> Dim vcGlDept as string = txtGLDept.text
>
> Dim vcDivision as string = txtDivision.text
>
> Dim vcChart as string = txtChart.text
>
> Dim vcInputFile as string = txtInputFile.text
>
> Dim vcAccountCode as string = txtAccountCode.text
>
> parms.setStringParameter(1, txtGroupID.Text,
> ParameterSet.INPUT)
>
> parms.setStringParameter(2, txtGLDept.Text,
> ParameterSet.INPUT)
>
> parms.setStringParameter(3, txtDivision.Text,
> ParameterSet.INPUT)
>
> parms.setStringParameter(4, txtChart.Text,
> ParameterSet.INPUT)
>
> parms.setStringParameter(5, txtInputFile.Text,
> ParameterSet.INPUT)
>
> parms.setStringParameter(6, errorFile, ParameterSet.INPUT)
>
> ThisPersistentProc =
> ThisProgressSession.runPersistentProcedure("ud\GLImport.p", parms)
>
> oTrans.ClearDataSets()
>
> oTrans.Refresh()
>
> Catch ex As Exception
>
> MessageBox.Show(ex.Message)
>
> End Try
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of Ross Robertson
> Sent: Thursday, June 30, 2011 4:45 AM
> To: Vantage Group
> Subject: [Vantage] Run 4GL code from vb.net app
>
> Hi,
>
> I was wondering if anyone has successfully been able to call a 4GL
> program on the server from a vb. NET app. Pass variables in and return
> data?
> I have been having a look at some documentation to do this but have not
> been able to get this to work.
>
> As a work around I can attach code to a bpm and get it to run, fill a ud
> table and retrieve but it's slow.
>
> Any help would be appreciated.
>
> Regards,
>
> Ross
>
> [Non-text portions of this message have been removed]
>
>


[Non-text portions of this message have been removed]
Hi,

I was wondering if anyone has successfully been able to call a 4GL program on the server from a vb. NET app. Pass variables in and return data?
I have been having a look at some documentation to do this but have not been able to get this to work.

As a work around I can attach code to a bpm and get it to run, fill a ud table and retrieve but it's slow.

Any help would be appreciated.

Regards,

Ross
Haven't actually tried it, but here is some code I got a while back:

Hi Mike



I'm not entirely sure as I don't have an example to hand, but I'd guess
at....



parms.setStringParameter(6, errorFile, ParameterSet.OUTPUT)



or



parms.setStringParameter(6, errorFile, ParameterSet.INPUT_OUTPUT)



...then after runPersistentProcedure...



Object o = parms.getOutputParameter(6)



or



Object o = parms.getParameterInOut(6)



where 6 is the index of the output param in parms.





Or if it's a procedure return value...



Object o = parms.ProcedureReturnValue()



Cheers



Trev



From: Mike Anstey [mailto:manstey@...]
Sent: 19 January 2010 15:02
To: Trevor Negus
Subject: FW: Calling .p



Hello Trevor, when calling a .p, how would you reference an output value
from the .p? e.g. you want the program to return something you can then
use as a variable in the screen.



________________________________

From: Anthony Knight [mailto:AKnight@...]
Sent: Thursday, December 03, 2009 1:47 PM
To: Mike Anstey
Cc: Trevor Negus
Subject: FW: Calling .p



Thanks Trev ;)



Once FB sign a WA, please feel free to send him any examples he requests
which we have "to hand" . If we need to create one, let him know how
long that will take and if he agrees, go for it ;)



Ant



From: Trevor Negus
Sent: 03 December 2009 16:38
To: Anthony Knight
Subject: Calling .p



' Call a Progress procedure directly



' You need to include custom references to:

' Progress.o4glrt.dll

' Epicor.Mfg.AD.SysAgent.dll



' also the following imports:

' Imports Epicor.Mfg.Core

' Imports Progress.Open4GL.DynamicAPI



' then something like the following should work within your button click


' you'll see the last thing this does is call a refresh.



Dim ThisSession As Epicor.Mfg.Core.Session = GLJournalEntryForm.Session



Dim ThisProgressSession As Progress.Open4GL.DynamicAPI.Session

Dim ThisPersistentProc As PersistentProc



Try

ThisProgressSession = ThisSession.ConnectionPool.Get()



Dim parms As ParameterSet = New ParameterSet(6)

'1 = group

'2 = DfltDept

'3 = DfltDiv

'4 = DfltChart

'5 = import

'6 = errlog



' Save these so can set back (after screen gets "refreshed")

Dim vcGlDept as string = txtGLDept.text

Dim vcDivision as string = txtDivision.text

Dim vcChart as string = txtChart.text

Dim vcInputFile as string = txtInputFile.text

Dim vcAccountCode as string = txtAccountCode.text



parms.setStringParameter(1, txtGroupID.Text,
ParameterSet.INPUT)

parms.setStringParameter(2, txtGLDept.Text,
ParameterSet.INPUT)

parms.setStringParameter(3, txtDivision.Text,
ParameterSet.INPUT)

parms.setStringParameter(4, txtChart.Text,
ParameterSet.INPUT)

parms.setStringParameter(5, txtInputFile.Text,
ParameterSet.INPUT)

parms.setStringParameter(6, errorFile, ParameterSet.INPUT)



ThisPersistentProc =
ThisProgressSession.runPersistentProcedure("ud\GLImport.p", parms)





oTrans.ClearDataSets()

oTrans.Refresh()



Catch ex As Exception

MessageBox.Show(ex.Message)

End Try





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Ross Robertson
Sent: Thursday, June 30, 2011 4:45 AM
To: Vantage Group
Subject: [Vantage] Run 4GL code from vb.net app





Hi,

I was wondering if anyone has successfully been able to call a 4GL
program on the server from a vb. NET app. Pass variables in and return
data?
I have been having a look at some documentation to do this but have not
been able to get this to work.

As a work around I can attach code to a bpm and get it to run, fill a ud
table and retrieve but it's slow.

Any help would be appreciated.

Regards,

Ross





[Non-text portions of this message have been removed]
> Hi,
>
> I was wondering if anyone has successfully been able to call a 4GL program on the server from a vb. NET app. Pass variables in and return data?
> I have been having a look at some documentation to do this but have not been able to get this to work.
>
> As a work around I can attach code to a bpm and get it to run, fill a ud table and retrieve but it's slow.
>
> Any help would be appreciated.
>
> Regards,
>
> Ross
>
>