GetListMembers

Descrizione

Restituisce i valori selezioni di un elenco dinamico.

Sintassi

VBScript

sessionObj.GetListMembers(list_name)

Perl

$sessionObj->GetListMembers(list_name);
Identificativo
Descrizione
session
L'oggetto Session che rappresenta la sessione di accesso al database corrente.
list_name
Una stringa che contiene il nome dell'elenco dinamico.
Valore di ritorno
Per Visual Basic, viene restituito un valore Variant che contiene un array i cui elementi sono stringhe. Ciascuna stringa contiene un valore elenco selezioni. Per Perl, viene restituito un riferimento a un array di stringhe.

Esempio

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;

Feedback