I put together a custom search, using viewtopic.php?f=27&t=184 and viewtopic.php?f=26&t=280 ...
- Code: Select all
Private Sub Search_Showing(sender As Object, e As System.EventArgs)
Dim jiwaSearch As JiwaApplication.JiwaSearch.clsSearch = DirectCast(sender, JiwaApplication.JiwaSearch.clsSearch)
With JiwaApplication.Manager.Instance.Search
If .CurrentSearchMode = JiwaApplication.JiwaSearch.clsSearch.SearchModes.jswDebtors Then
' Add Description to display
Dim aOption As New JiwaApplication.JiwaSearch.SearchOption
With aOption
.Title = "External Systems"
.SQLStr = "SELECT tbl.DebtorID,AccountNo,Name,ComcareClientId,JobNo,BpayCrn FROM ( SELECT s.DebtorID,AccountNo,Name,ComcareClientId,HCPNo,BpayCrn FROM DB_Main s, ( SELECT * FROM ( SELECT p.DebtorID, p.Contents, pd.SettingName FROM DB_CustomSettingValues p LEFT OUTER JOIN DB_CustomSetting pd ON pd.SettingID = p.SettingID ) tbl PIVOT ( MIN(tbl.Contents) FOR tbl.SettingName in (ComcareClientId,HCPNo,BpayCrn) ) piv ) p WHERE s.DebtorID = p.DebtorID) tbl LEFT JOIN JB_Main ON tbl.HCPNo = JB_Main.JobID "
.OrderBy = "ORDER BY AccountNo"
.AddColumn("DebtorID", vbString, "", 0, 1)
.AddColumn("Account No", vbString, "", 20, 2)
.AddColumn("Name", vbString, "", 29, 3)
.AddColumn("Comcare Client Id", vbString, "", 17, 4)
.AddColumn("HCP No", vbString, "", 17, 5)
End With
.Options.Add(aOption)
End If
End With
End Sub
All good, the new search displays perfectly ...
The trouble is that it doesn't filter results. Entering "3TIER" for example, doesn't change the result set at all.
Is this because of the the table joins in the query maybe? How to I accommodate this query?
Cheers,
Neil



