Returns a String array containing the IDs of selected records in listbox of the currently active modul.
Returns:
Type |
Value |
Description |
String |
array |
Array of type String, containing the contents of column id of the main table of the current modul (i.e. one of the following: addresses, events, infos, items, finances, locations). The record IDs of all records selected in the currently frontmost modul in Databox of WindowMain. |
Available in:
WindowMain |
WindowLink |
YES |
YES |
Used in:
XojoScript Name |
GUID |
Save As Excel sheet : participants list |
E50602AA-F1F7-42E6-A44A-78456DD9B778 |
Save as Excel sheet : seminar participants list |
03C22A3D-FF28-4E22-BB99-D7626BF5F0A4 |
Save as Excel sheet : seminar invoice list |
6DDAFA87-2862-4129-8416-CBD57C5CDF9A |
Hint: You can find more references to XojoScripts which make use of this function by sending the following SQL statement to the database:
Select id,GUID, ScriptName,ScriptCode from im_scripts where ScriptCode Like '%IDArrayOfSelectedRecords%'
Example XojoScript:
// print addresslist, from addresslist
Dim arID() As string
Dim numRecs As Integer
arID = IDArrayOfSelectedRecords
// Retrieve the index of the last element in the array arID.
numRecs = Ubound(arID)
Dim idStr As String
idStr = Join(arID,",")
Dim sql As String
sql = "SELECT Gender, Linkbox As 'Name'," _
+ "PostalCode,City,Country,Language As 'Lg'," _
+ "EmailAddress As 'Email',DirectPhone As 'Phone' " _
+ "FROM " + GetPrefix + "addresses WHERE id IN (" + idStr + ") " _
+ "ORDER BY LastName, FirstName"
Dim Records() As String
Dim FieldDelimiter As String = "**"
// Store Results in Array
Records = SQLSelect(sql,FieldDelimiter)
// Proceed if we have received any records
If Ubound(Records) > -1 Then
// If we produced an error, the returning record
// starts with the String : "ERROR"
If Left(Records(0),5)="ERROR" Then
MsgBox Records(0) // Display warning
Else
Dim ub As Integer = Ubound(records)
Dim i As Integer
Dim RecordDelimiter As String = "}{" // Use a string not existing in your data
Dim vAmount As Double
Dim vTotal As Double = 0
Dim vTotalStr,vAmountStr,myList As String
For i = 0 To ub
// Make each Field of retrieved record a new record in myList
myList = myList + NthField(records(i),FieldDelimiter,1) + RecordDelimiter // Gender
myList = myList + NthField(records(i),FieldDelimiter,2) + RecordDelimiter // Name
myList = myList + NthField(records(i),FieldDelimiter,3) + RecordDelimiter // Zip
myList = myList + NthField(records(i),FieldDelimiter,4) + RecordDelimiter // City
myList = myList + Uppercase(Left(NthField(records(i),FieldDelimiter,5),3)) + RecordDelimiter // Country
myList = myList + NthField(records(i),FieldDelimiter,6) + RecordDelimiter // Language
myList = myList + NthField(records(i),FieldDelimiter,7) + RecordDelimiter // Email
myList = myList + NthField(records(i),FieldDelimiter,8) + RecordDelimiter // Phone
Next
// Now print list
DoScript("WordAddressList.scpt",myList,RecordDelimiter)
End If
End If