GetActiveModul As String

 

Returns the name of the currently frontmost modul in the databox.

 

Certain XojoScript will run on all modules, like those which are asigned to a dynamic menu with Menu Editor. Others are the special scripts which run after Save or Delete was chosen from toolbar or from a menu. In such we need to determine the frontmost modul we are working on, like addresses or events, etc.

  

Returns:

 

Type

Value

Description

String

addresses

Indicates that modul addresses is currently active

String

events

Indicates that modul events is currently active

String

infos

Indicates that modul infos is currently active

String

items

Indicates that modul items is currently active

String

finances

Indicates that modul finances is currently active

String

locations

Indicates that modul locations is currently active

 

Available in:

 

WindowMain

WindowLink

YES

NO

 

 Used in:

 

XojoScript Name

GUID

Record update in databox

4A25A881-0947-45EF-B691-B81900C1ACEE

Record insert in databox

C05B0C75-E449-4752-AB16-65693A6A00A1

Record delete from databox

E8AC18FC-3956-42B8-AF94-86CF7FA5B10E

 

Example XojoScript:

 

If (IsEditMode = 1) Then

Dim modul As String = GetActiveModul

 

// Save was clicked after editing an event

If modul = "events" Then

 

// Script to update the participants counter

RunScript("A31B7E5A-7D69-4B60-9434-23A7FE1B8F0B")

 

End If

 

End If // IsEditMode