ars_GetListEntry(ctrl,schema,qualifier,maxRetrieve,...)
entry_id
s
and description (query list) strings from the specified schema. The entries
are returned as an array of (entry_id, query-list) pairs.
If you wish to retrieve all entries in the schema (upto the maximum
allowed by the server or specified by you as the maxRetrieve
parameter) you should load a Qualifier with something like
(1 = 1)
.
Setting maxRetrieve = 0
will return as many matches as
the server will allow.
undef
.
Note: prior to ARSperl 1.50 ars_GetListEntry
returned a
-1 on a call where the query matched more than the maxRetrieve
number of items from the database.
Example:
%entries = ars_GetListEntry($c, "User", $q, 100); foreach $entry_id (sort keys %entries) { print "EntryID: $entry_id Short-Descrip: $entries{$entry_id}\n"; }
Example (2.x or 3.x) of how to set sorting options:
# returns entries for User schema sorted by login name $all = ars_LoadQualifier($c,"User","1=1"); $login_name = ars_GetFieldByName($c,"User","Login Name"); @Entries = ars_GetListEntry($c, "User", $all, 0, $login_name, 1); for ( $i = 0; $i <= $#Entries; $i +=2 ) { $entry_num = $Entries[$i]; $description_fields = $Entries[$i+1]; }
Example (3.x only) of how to specify your own query list and sorting options:
%f = ars_GetFieldTable($ctrl, "User"); # retrieve list of matching records. query list should only # contain the Login name and Full Name fields. In addition, # query list should be reverse sorted by Login name. @a = ars_GetListEntry($ctrl, "User", $qual, 0, # getListFields [ {columnWidth=>5, separator=>' ', fieldId=>$f{'Login name'} }, {columnWidth=>5, separator=>' ', fieldId=>$f{'Full Name'} } ], # sort Order $f{'Login name'}, 1);
Last changes to this page 9 March 1998 by David Adams
© J.C.Murphy, J.W.Murphy 1998 arsperl@smurfland.cit.buffalo.edu