Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Xapi with own created Views PVS8

Status
Not open for further replies.

EVISSER

Programmer
Jun 3, 2003
32
AN
I am using this function to calculate the sum of all PO using a particular accountnumber in a specific Year. I created a view in PVS8 which runs fine (POCTB). When I run this function I get the following Runtime error:
Runtime error 2147467259 (80004005) View: POCTB. View Call Failed.

Help anyone please!

Function CalculatePOTotals(ByVal AccNr As String, FiscalYr As String) As Double
Dim POTOT As ACCPACXAPILib.xapiView

'Set Session = CreateObject("ACCPAC.xapisession")
Session.Open "ADMIN", "V1PER", "CTBDAT", Date, 0

Set POTOT = Session.OpenView("POCTB", "PO")

CalculatePOTotals = 0
POTOT.Init
POTOT.Browse "ITEMNO= " & AccNr, 1
POTOT.Fetch
Do While POTOT.Fetch
If Left$(POTOT("DATE"), 4) = FiscalYr And Trim(POTOT("ITEMNO")) = AccNr Then
Total = Total + CDbl(Trim(POTOT("OQORDERED"))) * CDbl(Trim(POTOT("UNITCOST"))) * CDbl(Trim(POTOT("Rate")))
End If
Loop
POTOT.Cancel
CalculatePOTotals = Total
End Function
 
I have never tried this , but from what I understand you will have to create your own view with the xAPI using view.createtables and perhaps some other calls.

I believe that the custom view needs to be registered with the xAPI (or SM or module via the xAPI) somehow (or the xAPI needs to be aware of it, be able to find it,etc.). Once the custom view is properly created and identified you should be able to use it.

Otherwise you can try using ADO to access your custom view.

zemp
 
Have you created a roto.dat file for your addin or added a new roto ID to the PO roto.dat?
 
You can't make you own views without the SDK. A SQL view isn't an Accpac XAPI view. You have to use ADO/ODBC.

Jay Converse
IT Director
Systemlink, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top