|
|
|
|
|
- Where to use gLink
- Added value
- Case sensitivity
- Auto-filled combo boxes
- Retrieved element
- Scheduler control
- Special case: Combo Box control or Combo in a Table field
gLink (Function) In french: gLien
Warning
From version 27, this function is kept for backward compatibility. It is recommended to use gStoredValue.
Adds an "invisible" value to an element in a List Box, Combo Box or Scheduler control. This value will be the stored value when the control element is selected by the user. Remarks: - To get the stored value associated with an element of the control, use the StoredValue property.
- To retrieve the value defined by gLink:
- use the gLinkActivate function.
   check "Return value specified with gStoredValue" ("Details" tab of the control description). In this case, the control will directly return the value of gLink that corresponds to the selected option.
ListAdd(COMBO_Title, "Mister" + gLink("1"))
Info(COMBO_Title[COMBO_Title].StoredValue)
Syntax
<Result> = gLink(<String to return>)
<Result>: Character string Control string that must be used in ListAdd, ListInsert or ListModify. <String to return>: Character string Text value to return. Only this string will be returned to the language. This string will not be displayed in the row. Remarks Where to use gLink gLink can be called anywhere in the row to be added. For example: ListAdd(COMBO_COMBO1, gLink("1") + "Monsieur")
ListAdd(COMBO_COMBO1, "Mister" + gLink("1"))
Added value Values added with gLink are not taken into account for sort operations and keyboard shortcuts. If multiple values are added to an element of a list box with gLink, only the first value will be returned. ListAdd(LIST_LIST1, "MyElement" + gLink("Link1") + gLink("Link2"))
In this example, only the "Link1" value will be returned. ListSeek takes into account the values added by gLink. gLink is case-insensitive. Therefore, the following code: ListAdd(LIST_LIST1, "MyElement" + gLink("AAA"))
will be equivalent to: ListAdd(LIST_LIST1, "MyElement" + gLink("aaa"))
gLink is used to manage "Auto-filled Combo Box" controls. When an element is retrieved from a List Box or Combo Box control, the priority order is as follows: - Values added by gLink.
- Values added by gToRetrieve.
To get the stored value associated with an element of the control, use the StoredValue property. If the resources in the schedule have been created with SchedulerAddResource using gLink, the name of the resource obtained with the SelectedResource property will correspond to the value specified in the gLink function for this resource. Example:
SchedulerAddResource(PLN_OccupancyRooms, Meeting.Name + gLink(Meeting.IDReunion))
...
MyAPT is Appointment
IF SCH_RoomOccupancy.SelectedResource = "" THEN
RETURN
END
MyAPT.StartDate = SCH_RoomOccupancy.StartDate
MyAPT.EndDate = SCH_RoomOccupancy.EndDate
MyAPT.Resource = SCH_RoomOccupancy.SelectedResource
Special case: Combo Box control or Combo in a Table field If gLink must return an empty string (""), the result will be different if the control used is a Combo Box control or a Combo Box column in a Table control. The following code is used: ListAdd(COMBO, "MyElement" + gLink(""))
the value retrieved will be: - an empty string ("") in the case of a Combo Box control,
- 0 (zero) in the case of a Combo Box column in a Table control.
To use the same code to retrieve the value of gLink for a Combo Box control and a Combo Box column, it is recommended to use a Combo Box control in a container column in the Table control.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|