Custom Function Template

On this page you can create or update a Custom Function Template.

Custom Function Templates are available to all Projects / Drafts in a URL.

The CQL Keyword will be used to extend the CQL language, with either a new Function or a new Method. For example if the Keyword is ‘ln’ and it is a Function then in CQL we can write:

ln(*.VS.WEIGHT)

and this will be translated in the Rave Edit Check to a Custom Function reference.

Similary a new Method can be defined, for example ‘HasOpenQuery’ and this can be used in the same way as built-in Rave methods like IsPresent:

*.VS.WEIGHT.HasOpenQuery

Again this will be translated into a Custom Function reference in the Rave Edit Check.

The Source Code can be C# or SQL and in either case valid Custom Function Code should be entered. The Source Code can contain named parameters, indicated like this:

return dp.DataPage.Records.Count {{comparator}} {{number}};

In this example 2 parameters have been defined, ‘comparator’ and ‘number’. When used in CQL the parameters are supplied like this:

NumLogLines(*.VS.WEIGHT, '<', 5)

In the Custom Function generated from the Template, the values for the parameters will be substituted, like this:

return dp.DataPage.Records.Count < 5;

Parameters are automatically detected in the Source Code.