Sorry everyone. I figured it out. My where clause had MATCHES mispelled.
Dan Godfrey
(805) 389-1935 x 251
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of dgodfrey_amc
Sent: Thursday, March 07, 2013 12:38 PM
To: vantage@yahoogroups.com
Subject: [Vantage] V8 Customization: Needing a second pair of eyes
I have a function that looks correct but the SearchFunction.ListLookup is not returning any data. what I am doing is selecting a Jobnum from the Job Search Button. So there should be at least 1 row. Yet I get zero rows and the recselected is False. Here is the function.
The debugging information is this:
GetTotalQuantityofCommonJobs Data:
- sJobNum = 62402-1
- swhereClause = JobNum MACTHES '62402*'
- dsSearch.tables(0).Tablename = JobHeadList
- dsSearch.tables(0).Rows = 0
- recSelected = False
Private Function GetTotalQuantityofCommonJobs (ByVal sJobNum As string) As Integer
Dim myJobHeadView As EpiDataView = CType(oTrans.EpiDataViews("JobHead"), EpiDataView)
WriteToLogFile("Inside of GetTotalQuantityofCommonJobs function")
Dim nDefaultQuantity As Integer = myJobHeadView.dataView(myJobHeadView.Row)("ProdQty")
Dim nQuantity As Integer = 0
Dim recSelected As Boolean = False
Dim msg AS String = String.Empty
Dim swhereClause AS String = "JobNum MACTHES '" & LEFT(sJobNum, 5) & "*'"
Dim row As DataRow
Dim dsSearch As DataSet
dsSearch = SearchFunctions.listLookup(oTrans, "JobEntryAdapter", recSelected, False, swhereClause, True)
'/*Debugging information */
msg = "GetTotalQuantityofCommonJobs Data:" & Chr(13) & Chr(10) _
& "- sJobNum = " & sJobNum & Chr(13) & Chr(10) _
& "- swhereClause = " & swhereClause & Chr(13) & Chr(10) _
& "- dsSearch.tables(0).Tablename = " & dsSearch.tables(0).Tablename & Chr(13) & Chr(10) _
& "- dsSearch.tables(0).Rows = " & dsSearch.tables(0).Rows.Count & Chr(13) & Chr(10) _
& "- recSelected = " & recSelected & Chr(13) & Chr(10)
MyMessageBox(msg, bDeveloperLoggedIn, MsgBoxStyle.OKOnly, "DEBUGGING MESSAGE")
If recSelected Then
For Each row In dsSearch.tables(0).Rows
nQuantity = nQuantity + row.Item("ProdQty")
Next
Else
MyMessageBox("The JobNum entered can not be found for SUMMATION.", True, MsgBoxStyle.OKOnly, "Invalid Job Number")
nQuantity = nDefaultQuantity
End If
Return nQuantity
End Function
------------------------------------
Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
Dan Godfrey
(805) 389-1935 x 251
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of dgodfrey_amc
Sent: Thursday, March 07, 2013 12:38 PM
To: vantage@yahoogroups.com
Subject: [Vantage] V8 Customization: Needing a second pair of eyes
I have a function that looks correct but the SearchFunction.ListLookup is not returning any data. what I am doing is selecting a Jobnum from the Job Search Button. So there should be at least 1 row. Yet I get zero rows and the recselected is False. Here is the function.
The debugging information is this:
GetTotalQuantityofCommonJobs Data:
- sJobNum = 62402-1
- swhereClause = JobNum MACTHES '62402*'
- dsSearch.tables(0).Tablename = JobHeadList
- dsSearch.tables(0).Rows = 0
- recSelected = False
Private Function GetTotalQuantityofCommonJobs (ByVal sJobNum As string) As Integer
Dim myJobHeadView As EpiDataView = CType(oTrans.EpiDataViews("JobHead"), EpiDataView)
WriteToLogFile("Inside of GetTotalQuantityofCommonJobs function")
Dim nDefaultQuantity As Integer = myJobHeadView.dataView(myJobHeadView.Row)("ProdQty")
Dim nQuantity As Integer = 0
Dim recSelected As Boolean = False
Dim msg AS String = String.Empty
Dim swhereClause AS String = "JobNum MACTHES '" & LEFT(sJobNum, 5) & "*'"
Dim row As DataRow
Dim dsSearch As DataSet
dsSearch = SearchFunctions.listLookup(oTrans, "JobEntryAdapter", recSelected, False, swhereClause, True)
'/*Debugging information */
msg = "GetTotalQuantityofCommonJobs Data:" & Chr(13) & Chr(10) _
& "- sJobNum = " & sJobNum & Chr(13) & Chr(10) _
& "- swhereClause = " & swhereClause & Chr(13) & Chr(10) _
& "- dsSearch.tables(0).Tablename = " & dsSearch.tables(0).Tablename & Chr(13) & Chr(10) _
& "- dsSearch.tables(0).Rows = " & dsSearch.tables(0).Rows.Count & Chr(13) & Chr(10) _
& "- recSelected = " & recSelected & Chr(13) & Chr(10)
MyMessageBox(msg, bDeveloperLoggedIn, MsgBoxStyle.OKOnly, "DEBUGGING MESSAGE")
If recSelected Then
For Each row In dsSearch.tables(0).Rows
nQuantity = nQuantity + row.Item("ProdQty")
Next
Else
MyMessageBox("The JobNum entered can not be found for SUMMATION.", True, MsgBoxStyle.OKOnly, "Invalid Job Number")
nQuantity = nDefaultQuantity
End If
Return nQuantity
End Function
------------------------------------
Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links