IsLinkMode As Integer

 

Used to determine the current operation state.

 

If 1 is returned, then the user is about to edit or add a registration in WindowLink. Otherwise 0 is returned.

 

When the user has the appropriate permissions, then he can enter LinkMode by selecting menu EDIT, REGISTER (+R), or by clicking the Link Icon () on the toolbar.

 

Returns:

 

Type

Value

Description

Integer

1

The current state is linking.

The user has started to edit or add a registration in WindowLink.

 

0

The current state is NOT linking.

 

 

Available in:

 

WindowMain

WindowLink

NO

YES

 

 Used in:

 

XojoScript Name

GUID

Edit Registration

89F9973D-C3A4-4466-BAE7-8AE85115AE09

 

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 '%IsLinkMode%'

 

Example XojoScript:

 

If IsLinkMode = 1 then

// Running Script AFTER LinkMode was set.

 

// Run this code only if we are doing a seminar registration

If GetActiveLinking = "link_adr_evt" Then

 

// Define listbox name

Dim lb As String = "imLB_lnk_p01_ItemsOrdered"

 

If ListCount(lb) = 0 Then

 

// Set number of persons to 1, if empty

If GetText("imTF_lnk_p01_NumParticipants") = "0" Then

SetText("imTF_lnk_p01_NumParticipants","1")

End If

 

// Set status to confirmed, if not set yet

If GetText("imPO_lnk_p01_Participation") = "" Then

SetText("imPO_lnk_p01_Participation","Confirmed")

End If

 

// Set Currency to CHF, if address is from CH/FL, else Euro

If GetText("imPO_lnk_p01_Currency") = "" Then

// Retrieve invoice destionation country

Dim country As String

country = Trim(Uppercase(GetText("imCO_adr_Country", LinkList_GetID("adr"))))

If (country = "CH") Or (country = "FL") Then

SetText("imPO_lnk_p01_Currency","CHF")

Else

SetText("imPO_lnk_p01_Currency","EUR")

End If

End If

End If

End If // GetActiveLinking = "link_adr_evt"

 

Else

// "Running Script AFTER  saving and returning to ViewMode."

End If