GetWorkgroupItem

Searches the current repository for a workgroup with a specific name or reference, then returns a specific piece of information about that workgroup.

Syntax

GetWorkgroupItem( WorkgroupReference, ItemType, IsWorkgroupName );

Parameters

Parameter Name Type Description Optional? Default Value
WorkgroupReference String The email address of a workgroup user in the current repository. No n/a
ItemType Integer Determines what information the function will return. No n/a
IsWorkgroupName Boolean Determines if the WorkgroupRef should be interpreted as the workgroup's reference or its name. If left as 0, the reference will be used. Yes 0

Output

The function will return a different value depending on the integer specified in ItemType:

  • 1 - Returns the workgroup's Account Code.
  • 2 - Returns the workgroup Reference.
  • 3 - Returns the workgroup's Name.
  • 4 - Returns the Email address associated with the workgroup.
  • 5 - Returns True or False, depending on whether the workgroup is Enabled.

Use Case

The user of a particular application is given the option to select a workgroup using a Workgroup Filtered Choice question. The name returned by this question can then be used as part of a GetWorkgroupItem function call that fetches the e-mail address associated with the workgroup, then sends an e-mail to that address.

The name of the workgroup is passed into a variable called VARChosenWorkgroup, and the result of the function call is passed to a second variable named VARWorkgroupEmail:

VARWorkgroupEmail:= GetWorkgroupItem( VARChosenWorkgroup, 4 );