Selectrecord adds a record to a selection of records.
command=selectrecord&<parameter>=<value>&...
output
can be either json
or xml
(xml
is the default, so you don't need to specify that explicitly). However, the output format produced by jQuery applications is always JSON, so you don't need to specify the output type there either.output=json
, because the output format is JSON by default.
You can use a selection to collect records (with getselections) for some common goal, like storing them in a saved search (aka pointer file).
A selection can only be made if in the current session a search yielded a result set, and you want to select a record in that result set. The selection remains intact during the current session and applies only to this session (so you won't be able to observe a WebAPI record selection in your Collections application). In the return XML, selected records have the attribute selected="True"
present in the <record>
node, for example: <record priref="2" selected="True">
.
Start a stateful session show
For selection commands to work, an active session is required. Usually, a session will be started implicitly when the user begins submitting WebAPI requests, so this explicit startsession
command will often not be required. See the startsession command documentation for more information.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&command=startsession
Search all records: return all records from collect.inf show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=all
From the result set of the example above, select the record with record number 2 show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&command=selectrecord&priref=2
- no Adlib.Data-specific description available yet; see the URL request tab for all information -
Return all records from collect.inf and from the result set, select the record with record number 2 show
// Prepare a record set for results recordSet = new AdlibRecordSet(conn, "collect.inf"); // Search all records recordSet.Search("all"); // Select record 2 recordSet.SelectRecord(2);
- no jQuery-specific description available yet; see the URL request tab for all information -
Return all records from collect.inf and from the result set, select the record with record number 2 and then deselect it show
var url = "http://test2.adlibsoft.com/api/wwwopac.ashx"; $().adlibdata(url, { database: "collect.inf", search: "all" }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); $().adlibdata(url, { database: "collect.inf", command: "selectrecord", priref: 2 }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); $().adlibdata(url, { database: "collect.inf", command: "deselectrecord", priref: 2 }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); }); }); });