Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
Sage MAS 500 Customer
DennisCase
Posts: 7
Registered: 02-25-2010
0
Accepted Solution

Launch vb6 task from .net w/ parameter

I want to launch the Maintain Customers task from my .net app, passing a CustID to load.

I'm able to launch the task using:

Shell("C:\WINDOWS\system32\BusinessDesktopLoader.exe /T83952612 ")

But I don't know how to pass the CustID.

Any suggestions?

 

thanks

Dennis Case

PediFix, Inc. 

Super Contributor
DFeller
Posts: 2,943
Registered: 10-28-2008
0

Re: Launch vb6 task from .net w/ parameter

Sage MAS 500 Customer
DennisCase
Posts: 7
Registered: 02-25-2010

Re: Launch vb6 task from .net w/ parameter

Thanks Dawn.

 

 I knew I had seen/done this before.

The reference to Screen Pops reminded me of where... I had done a Screen Pop utility a couple of years ago.

 

For those interested in the solution, here's the code I used.  Very flexible for launch mas500 tasks.

 

 

Private _Session As Accounting.Framework.Session Private _Launcher As Accounting.Framework.Launcher Private Function CreateXMLContext(ByVal pEntityColumnID As String, ByVal pEntityID As String) As String If IsNothing(pEntityColumnID) Or IsNothing(pEntityID) Then Return "<Environment><Context><CompanyID Value = " & Quote & _Session.CompanyID & Quote & " /></Context></Environment>" Else Return "<Environment><Context><CompanyID Value = " & Quote & _Session.CompanyID & Quote & " />" & "<" & pEntityColumnID & " Value =" & Quote & pEntityID & Quote & "/></Context></Environment>" End If End Function Public Sub LaunchMAS500Task(ByVal pTaskID As Int32, Optional ByVal pEntityColumnID As String = Nothing, Optional ByVal pEntityID As String = Nothing) Try If IsNothing(_Launcher) Then _Launcher = New Launcher(_Session) End If Dim TaskContext As String = CreateXMLContext(pEntityColumnID, pEntityID) Dim SessionContext As String = "" 'Use Launcher to launch task _Launcher.LaunchTask(pTaskID, Constants.TaskLaunchTypes.Standard, TaskContext, SessionContext) Catch ex As Exception Msg(TraceSwitchApplication, TraceLevel.Error, "Error launching MAS500 task." & vbCrLf & ex.Message) End Try End Sub Private Sub btnCustMaint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCustMaint.Click 'Launch Customer Maintenance task for this customer LaunchMAS500Task(83952612, "CustID", CustID) End Sub

 

 

Dennis Case

PediFix, Inc.

Contributor
dyataco
Posts: 11
Registered: 06-13-2011
0

Re: Launch vb6 task from .net w/ parameter

this code doesn't run on 7.3