Show/Hide Toolbars

TMS XData Documentation

Navigation: URL Conventions

Custom Functions

Scroll Prev Top Next More

Besides the built-in functions you can use in $filter and $orderby query options, you can also register your own custom functions. Such functions will then be translated into Aurelius' LINQ "SQL functions" that also need to be previously registered for the query to work.

 

For example, to register a function named "unaccent":

 

uses {...}, XData.Query.Parser;
 
TQueryParser.AddMethod('unaccent', TQueryMethod.Create('unaccent'1));

 

The numeric parameter (1) indicates the number of parameters the function receives.

Then to use the function from query API:

 

http://server:2001/tms/xdata/Customer?$filter=unaccent(Name) eq 'Andre'