Used to determine the current operation state.
If 1 is returned, then the user is about to insert a new record. Otherwise 0 is returned.
When the user has the appropriate permissions, then he can enter InsertMode by selecting menu EDIT, INSERT NEW (⌘+I), or by clicking the plus Icon on the toolbar.
Returns:
Type |
Value |
Description |
Integer |
1 |
The current state is inserting. The user has started to add a new record in databox. |
|
0 |
The current state is NOT inserting. |
Hint: When writing XojoScripts which inserts records to the database, then we may want to verify if the user is in InsertMode,
which implies that he has the appropriate rights to do so.
Available in:
WindowMain |
WindowLink |
YES |
NO |
Used in:
XojoScript Name |
GUID |
Record insert in databox |
C05B0C75-E449-4752-AB16-65693A6A00A1 |
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 '%IsInsertMode%'
Example XojoScript:
If (IsInsertMode = 1) Then
If GetActiveModul = "addresses" Then
Dim company As String = GetText("imTF_adr_OrganizationName")
Dim lastname As String = GetText("imTF_adr_LastName")
// Either one must be filled out, abort if empty
If lastname = "" And company = "" Then
MsgBox("Please fill out either 'Lastname' or 'Company'." + EOL + EOL + "This record has not been saved.")
// Cancel saving of data
AbortInsert("TRUE")
Return
End If
Dim label As String = GetText("imTA_adr_Label")
Dim salutation As String = GetText("imTF_adr_Salutation")
Dim linkbox As String = GetText("imTF_adr_Linkbox")
// Generate label, salutation and linkbox text if either one is missing
If label = "" Or salutation = "" Or linkbox = "" Then
// Script to generate label, salutation and linkbox text
RunScript("74855E25-5542-4B9D-B821-04C414425526")
End If // label = ""
End If // ActiveModul = addresses
End If // IsInsertMode