Question: In SalesLogix is it possible to have one recordset for all selected
datagrid rows? I know the following to retrieve IDs for selected
datagrid rows –
For i = 0 to DataGrid1.Selection.Count – 1
id = DataGrid1.Selection(i)
‘ do something with the ID value
idlist = idlist & id & vbCrLf
Next
and …
Set objRS = GetSelectedRecordByID(
Dim idlist
‘ get a list of all ID values
For i = 0 to DataGrid1.Selection.Count – 1
idlist = idlist & “‘” & DataGrid1.Selection(i) & “‘,”
Next
‘ trim off trailing comma
If Len(idlist) > 1 Then idlist = Left(idlist, Len(idlist)-1)
‘ now open the recordset
Set rs = Application.GetNewConnection.
* from ” & Left(DataGrid1.KeyField, Len(DataGrid1.KeyField)-2)
& ” where ” & DataGrid1.KeyField & ” in (” & idlist
& “)”)
‘ now do what you want with “rs” – this is a recordset of the selected rows
There
are better ways to get the recordset query so you can retain the same
base query that the grid is based on. Locate the WHERE part of the
query and stick in the part for the primaryid in the IDList.



