metadata_contains

The function metadata_contains tests if a metadata attribute is set on a dynamic object.

 metadata_contains (attribute; value)

The result of the function metadata_contains is of type BOOL.

This function has two parameters:

  1. attribute. This is the metadata attribute to be tested.
  2. value. This is the value that is tested for.

The function metadata_contains returns TRUE if the attribute is set on the dynamic object; otherwise, it returns FALSE. If value is not a valid attribute, the Master Template stops, and a run-time error is reported.

The metadata_contains function can only be used within the execution scope of a filter function. If you call the metadata_contains function directly, the Master Template stops, and a run-time error is reported.

Examples are provided here.

FILTER
FUNC BOOL texas (FIELDSET Set)
DO
  ASSIGN texas := metadata_contains ("State"; "TX")
OD

The preceding example filters all objects where the metadata attribute "State" has the value "TX" set.

FILTER
FUNC BOOL state (FIELDSET Set)
DO
  ASSIGN state := metadata_contains ("State"; _data.Customer.State)
OD

The second example filters all objects where the metadata attribute "State" contains the value from the Customer.State field in the Data Backbone.