writerecord
Writerecord (deprecated) writes a new or updated record to a database.
Syntax
command=writerecord&<parameter>=<value>&...
-
database
(String)
database on which to perform the writerecord function. The name of this database must have been specified in the adlibweb.xml file.
-
data
(String)
the record(s) to write; data constitutes the data in the form of XML which must be written back to the database. In principle it is possible to update or write a new record by entering the relevant data in the URL directly, but that is a deprecated method. Instead, use the POST method to send record data to the web server.
Include the writeAllowed
setting in adlibweb.xml, otherwise records can’t be written to the database.
The user who wants to write or update a record in the database, must have write access in the Axiell Collections application. The user name must either be passed in this URL or make sure that the write process runs under the right identity.
Assign priref 0 with the writerecord command to indicate that a new record must be created: the new record will get a number just one higher than the highest existing record in the database. If the database is subdivided into datasets, and the record must be created in one of these datasets, then specify this dataset in the databaseConfiguration section of the relevant database in adlibweb.xml, like so for example: collect>extern
.
The written record will be merged with an existing record if you submit an existing priref. This means that only the provided fields will be written to the existing record; other fields in the existing record will keep the value they already had.
-
xmltype
(String)
[optional] type of xml to be written ('grouped' or 'unstructured')
-
output
(String)
[optional] output format to be returned. Values for
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.
Read more about JSON output here.
-
callback
(String)
[optional] returns JSON output wrapped in brackets with your callback function name, for AJAX requests: <callback function name>( <JSON output> ); You don't need to specify
output=json
, because the output format is JSON by default.
Description
This command is now deprecated; use insertrecord, updaterecord, or deleterecord instead.
To update (edit and save) an existing record via de Axiell WebAPI, you have to know the record number (priref) of the record you want to update. This priref can be obtained by searching for the desired record first, in any of the different ways described elsewhere in this documentation. Although not a strict requirement, it is probably safest to lock the record before editing it, so that no-one else can edit the record simultaneously. After updating or writing a record it will be unlocked automatically. Only if you decide not to update a locked record, you'll have to unlock it explicitly.
The writing of records resolves links and it manages reverse links, but internal links are not dealt with.
Examples
Description
- no Adlib.Data-specific description available yet; see the URL request tab for all information -
Examples
Description
- no jQuery-specific description available yet; see the URL request tab for all information -
Examples