Call web services from Ms office

>
> I trying to create an complete job, an order and report labor/production.
>

Picking the small items, are we? ;-)

So far, the most complicated business object I've dealt with is the
Engineering Workbench, but I would imagine that Sales Order entry wouldn't be
far behind. Will your customers, ship-tos, Parts (engineered), terms, etc.
already exist before trying to add the order? Will you be shipping from Jobs
(Make Direct)? Did you get MES seats?

Are you trying to feed Vantage from an existing Access application?

Anyway, you asked for code. Here's an example (below) of reading from an
Access database (via ODBC) that will update part costs. (This program fragment
is from our implementation, so we used the cost adjustment program. I would
use the Costing Workbench from here on out.) This VB.Net program reads from an
access table and updates the cost.

Maybe it would be easier for you to pull data from Access rather than trying
to control Vantage? Just a thought. If you want to call .Net from a COM
application like MS Office, you'll have to write some wrappers. (Here's an
example: http://www.codeproject.com/dotnet/nettocom.asp)

HTH,

Mark W.

' Need to add appropriate references to the project

Dim IConn As New Odbc.OdbcConnection("DSN=Import;uid=;pwd=;")
Dim Cmd As New _
Odbc.OdbcCommand("select PartNum, Mcst from tblNewCosts order by partnum")
Dim strPart, errMsg As String
Dim dblMcst As Double
Dim rdr As Odbc.OdbcDataReader

IConn.Open()
Cmd.Connection = IConn

Try
' Login into Vantage
objSess = New _
Epicor.Mfg.Core.Session("username", "password", _
"AppServerDC://UFMERP:8321", _
Epicor.Mfg.Core.Session.LicenseType.Default)
' Create a part object
objPart = New Epicor.Mfg.BO.Part(objSess.ConnectionPool)
' Create a cost object
objCost = New Epicor.Mfg.BO.CostAdjustment(objSess.ConnectionPool)
' Create cost dataset
dsCost = New Epicor.Mfg.BO.CostAdjustmentDataSet

' Execute ODBC statement
rdr = Cmd.ExecuteReader()

' For each record, update the cost
While rdr.Read()
strPart = Trim(rdr("partnum"))
dblMcst = rdr("mcst")
' See if part exists
If objPart.PartExists(strPart) Then
' Create a new cost adjustment row
rowCost = dsCost.CostAdjustment.NewCostAdjustmentRow()
' Fill in the values
rowCost.DummyKeyField = 1
rowCost.PartNum = strPart
rowCost.Reference = "Implementation"
rowCost.ReasonCode = "IMPL"
rowCost.ReasonCodeDesc = "Implementation"
rowCost.Company = "UFM"
rowCost.CostMethod = "S"
rowCost.StdMtlUnitCost = dblMcst
rowCost.StdBurUnitCost = 0
rowCost.StdLbrUnitCost = 0
rowCost.StdMatBurUnitCost = 0
rowCost.StdSubUnitCost = 0
rowCost.StdTotUnitCost = dblMcst
rowCost.LastBurUnitCost = 0
rowCost.LastLbrUnitCost = 0
rowCost.LastMatBurUnitCost = 0
rowCost.LastMtlUnitCost = dblMcst
rowCost.LastSubUnitCost = 0
rowCost.LastTotUnitCost = dblMcst
rowCost.AvgBurUnitCost = 0
rowCost.AvgLbrUnitCost = 0
rowCost.AvgMatBurUnitCost = 0
rowCost.AvgMtlUnitCost = 0
rowCost.AvgSubUnitCost = 0
rowCost.AvgTotUnitCost = dblMcst
rowCost.TransDate = #11/5/2006#
' Add the row to the dataset
dsCost.CostAdjustment.AddCostAdjustmentRow(rowCost)
' Update the cost
Try
objCost.SetCostAdjustment(dsCost)
Catch ex As Exception
Console.WriteLine(ex.Message & ":" & strPart)
End Try
dsCost.Clear()
End If
End While
Catch ex As Exception
Console.WriteLine(ex.Message & ":" & strPart)
End Try

> -----Original Message-----
> From: Mark Wonsil [mailto:mark_wonsil@...
> <mailto:mark_wonsil%40yahoo.com> ]
> Sent: Sunday, November 05, 2006 10:23 AM
> To: Roger@office
> Subject: RE: [Vantage] call web services from Ms office
>
> Hi Roger,
>
> > I attempting to call a web service from an access application and can not
> > get it to work. Support has been no help.
> >
> > Has any one gotten this to work? I could sure use a code example,
>
> Others have pushed me away from the Web Services and towards using the
> Vantage
> Business Objects directly. What transaction are you trying to do?
>
> Mark W.
>
>
>
>
I attempting to call a web service from an access application and can not get it to work. Support has been no help.

Has any one gotten this to work? I could sure use a code example,

thanks,

Roger Rabus
Logical Solutions
314 215-0044
I trying to create an complete job, an order and report labor/production.


-----Original Message-----
From: Mark Wonsil [mailto:mark_wonsil@...]
Sent: Sunday, November 05, 2006 10:23 AM
To: Roger@office
Subject: RE: [Vantage] call web services from Ms office

Hi Roger,

> I attempting to call a web service from an access application and can not
> get it to work. Support has been no help.
>
> Has any one gotten this to work? I could sure use a code example,

Others have pushed me away from the Web Services and towards using the Vantage
Business Objects directly. What transaction are you trying to do?

Mark W.