Description
In this event you can modify values received from the database or REST API. The event is called right after the record is retrieved from the datasource and before any other processing.
This event can be useful when you need to transform received from the external datasource into a format that ASPRunner.NET understands and need to do this on all pages.
Applies to pages
All table-level pages that work with data received from the database or from REST API: List, View, Print, Edit, Export.
Syntax
public XVar ProcessRecords(values)
Arguments
values
an array with values representing a single record received from the database or from REST API.
Return value
no return value
Example 1
REST API returns dates in epoch format ( number of seconds that have elapsed since January 1, 1970 ) and we need to convert them to a standard database format yyyy-mm-dd hh:mm:ss so the rest of our applications understands it.
DateTimeOffset dateTimeOffset = DateTimeOffset.FromUnixTimeSeconds(values["DateField"]);
DateTime dateTime = dateTimeOffset.DateTime;
values["DateField"] = dateTime.ToString();
Recommended sample events
See also: