GetListMembers

Description

Returns the choice values of a dynamic list.

Syntax

VBScript


sessionObj.GetListMembers(list_name)

Perl


$sessionObj->GetListMembers(list_name);
Identifier
Description
session
The Session object that represents the current database-access session.
list_name
A String containing the name of the dynamic list.
Return value
For Visual Basic, a Variant containing an Array whose elements are strings is returned. Each String contains a choice list value. For Perl, a reference to an array of strings is returned.

Example

VBScript

set sessionObj = GetSession

sessionObj.UserLogon "admin", "", "SAMPL", AD_PRIVATE_SESSION, ""

List = sessionObj.GetListMembers("test")

' Get the Count before continuing.

' If the count is 0, specify a user database
' with some dynamic lists defined.

For Each listName In List

MsgBox listName

Next

Perl

# Perl Example 1

$sessionObj = $entity->GetSession();

$sessionObj->UserLogon("admin","","SAMPL","");

$list = $sessionObj->GetListMembers("test");

# If the count is 0, specify a user database
# with some dynamic lists defined.
foreach $x (@$list){
  print "List:$x\n";
}

# Perl Example 2

# check if a field value is included in a dynamic list
$result = "Invalid HW_Version entered";

# selected value must be from dynamic list
my $field_value = $entity->GetFieldValue($fieldname)->GetValue();
my $valid_values = $session->GetListMembers("HW_Versions");

foreach (@$valid_values) {
    if ($field_value eq $_) {
        $result = "";
        return $result;
    }
}
return $result;