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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AccpacFinder.ViewFinder in VB.NET

Status
Not open for further replies.

Bluejay07

Programmer
Mar 9, 2007
780
CA
Hello,

In VB 6, I used the following code to access the view finder.

Code:
Dim oFind As AccpacFinder.ViewFinder

Set oFind = New AccpacFinder.ViewFinder
oFind.Session = cmSess
oFind.DisplayName = CSCOMPANY.Name
oFind.ViewID = "AR0024"
oFind.ViewOrder = 0
oFind.SearchFieldIDs = Array(1, 2, 3)
oFind.DisplayFieldIDs = Array(1, 2, 3)
oFind.ReturnFieldIDs = Array(1, 2)
oFind.Filter = ""
oFind.Finder

If Not IsEmpty(oFind.ReturnFieldValues) Then
   If Len(oFind.ReturnFieldValues(0)) > 0 Then
     txtID.text = Trim$(oFind.ReturnFieldValues(0))
   End if
End if

Set oFind = Nothing

What would the equivalent to this be in VB.NET? I have searched but have not found a solution.

Thanks.
 
Hello,

After several attempts, I seem to have figured this out.

For anyone else that may be interested, here is the code I used.

Code:
Dim oFind As AccpacFinder.ViewFinder
Dim SearchArray() As Object = {1, 2, 3}
Dim DisplayArray() As Object = {1, 2, 3}
Dim ReturnArray() As Object = {1, 2}  

Try
   Me.Cursor = Cursors.WaitCursor

   oFind = New AccpacFinder.ViewFinder
   oFind.Session = cmSESS
   oFind.ViewID = "AR0024"
   oFind.ViewOrder = 0
   oFind.SearchFieldIDs = SearchArray
   oFind.DisplayFieldIDs = DisplayArray
   oFind.ReturnFieldIDs = ReturnArray
   oFind.Filter = ""
   oFind.Finder()

   If Not IsNothing(oFind.ReturnFieldValues) Then
      txtID.Text = Trim(oFind.ReturnFieldValues(0))
   End If

   oFind = Nothing

Catch ex as Exception
   Messagebox.Show(ex.message)
End Try
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top