GetCurrentID As Integer

 

Returns the ID of the last record loaded in detail view, of the currently active (frontmost) modul.

   

Returns:

 

Type

Value

Description

Integer

>0

ID of a record in databox.

Example: If addresses is the currently active modul, then the id of the last address is returned, which was displayed in detail view. And likewise for all other modules (events, infos, items, finances, locations)

 

Available in:

 

WindowMain

WindowLink

YES

NO

 

 Used in:

 

XojoScript Name

GUID

Calculate balance of finances

6D428996-6DF1-4548-AEE3-117EC7E2D20C

Count participants in events

A31B7E5A-7D69-4B60-9434-23A7FE1B8F0B

 

Example XojoScript:

 

// Count participants in events

Dim sql As String

Dim Records() As String

Dim total As String

 

 

sql = "SELECT Count(*) Total FROM " + GetPrefix + "link_adr_evt " _

+ "WHERE id_evt = " + Str(GetCurrentID)

 

// Store Results in Array

Records = SQLSelect(sql)

 

// 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

total = Records(0)

 

SetText("imTF_evt_Registrations",total)

 

End If

End If