How to load the Advanced search form via breakout script

Discussions relating to breakout scripting, .NET and COM programming with Jiwa objects.

How to load the Advanced search form via breakout script

Postby Mike.Sheen » Wed Nov 05, 2008 3:44 pm

This little snippet shows how you can leverage the Advanced search window via breakout script (or your 3rd party Vb6 or .NET apps).

This example will override the grid button click on the Inventory Maintenance form, and cause the advanced search form to load for inventory selection - in fact the same one that is loaded on the sales order form.

This example is obviously not very practical, but it does show simply how to use this search function.

You can create your own searches by populating the tables SY_SearchTypes, SY_SearchQueries and SY_SearchColumns - and you invoke it the same way as the example below, but just provide the name you gave your search in the SY_SearchTypes instead.

Code: Select all
' Form Grid ButtonClick Before breakout
rtnCancel = True

Dim LookupUI
Dim MyLoop

Set LookupUI = CreateObject("JiwaLookupUI.StdFunctions")
Set LookupUI.Database = InventoryObject.Database
Set LookupUI.myOwnerForm = FormObject

' Set some pre-typed keystrokes...
LookupUI.PreTypedKeys = "abc"

If LookupUI.Setup(1, "Sales Orders Inventory", "Sales Order Lines Lookup") Then
    LookupUI.Show

    If LookupUI.ExposedForm.Search.Results.Count > 0 Then
      ' Process Results
      For MyLoop = 1 To LookupUI.ExposedForm.Search.Results.Count         
         MsgBox LookupUI.ExposedForm.Search.Results(MyLoop).Fields("InventoryID").Value
      Next
    End If
End If

Set LookupUI = Nothing

End Sub
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Return to Technical / Programming

Who is online

Users browsing this forum: No registered users and 3 guests