Conditional To Clauses

IF (expression) <to_clause>

[ELSEIF (expression) <to_clause>]….

[ELSE <to_clause>]

To use the TO clause conditionally based on the data in an object, use the IF/ELSEIF/ELSE element.

If the condition of the (expression) is true, the TO clause will be executed. The (expression) value is an equivalency in the form:

<field> = <value>

The <field> value is the object field, and <value> can be any integer, real number, or string that the <field> can match. The <value> can also be a table type id in the form:

<field> = TABLE <table>

The <table> value is the table type.

In the example below, the object being evaluated is called the participant. In this case, the participant object is a Clarify object that contains an exclusive relation that can go to a site, subcase, contact, or some other object type. The field focus_type points to the object type being related to, and the field focus_lowid is the relation to that object. A possible result of this clause: If the expression ( focus_type = TABLE (subcase) ) evaluates to true, the routine reference_site_through will run.

IF ( focus_type = TABLE(site) ) reference_site_through (focus_lowid)

ELSEIF ( focus_type = TABLE (subcase) ) reference_subcase_through(focus_lowid)

ELSEIF ( focus_type = TABLE (contact) ) reference_contact_through (focus_lowid)

ELSE TO_EXCLUSIVE focus_type THROUGH focus_lowid

ACTIONS = EXPORT_REF

END_TO

See Also

Common Purge/Archive Directives Elements

Export Object

Uniques

Where

Actions

Stop Ifs

To Clauses

Routines

Next

Routines

Conditional To Clauses