context

Returns the record that will be implicitly used in a calculation.

Function

context()

Arguments

ArgumentData Type
resultentity

Comments

The context function explicitly returns the record that would otherwise be implicitly used for accessing fields.

Typically a calculation will implicitly be working in the context of some record, so field and relationship names such as [First Name] can be typed directly and are implicitly understood. However, sometimes the record itself is needed and the context function provides this. Put differently, context().[Some field] is always equivalent to [Some field]

A common use of the context function is when a calculation needs to refer to a field or relationship that is defined on some object that inherits the current record.

Examples

Assume that the following is a calculated column on a report of Vehicle records, where:

  • Car inherits from Vehicle
  • Registration is a field on Car
convert(Car, context()).[Registration]   --  this will return the registration when the current row is a Car record