Skip to content

Foreign_Field_Options - DataDictionary

Allows you to assign additional item options to a field type when that field type is used as a parent field

Type: Property
Access: Read/Write
Data Type: Integer
Parameters: None

Parameters

Parameter Type Description
iField Integer Number of the column in the table

Syntax

Property Integer Foreign_Field_Options
Access Type Syntax
Read Access: Get Foreign_Field_Options to IntegerVariable
Write Access: Set Foreign_Field_Options to IntegerVariable/Value

Description

When setting foreign field options in the DataDictionary class at design-time, it is best to use Set Foreign_Field_Option and not Set Foreign_Field_Options. That way, the DataDictionary Modeler can figure out individual option settings.

However, something like clear-all-options is most easily accomplished with Set Field_Options. The drawback is that the Studio's DD class modeler won't know that you've done that. That probably doesn't matter too much because you are probably not doing this at design-time. You are probably doing this in some custom method that changes these options at runtime, rather than design time.

When an entry item refers to a table.column that is an ancestor of its DataDictionary object's (DDO's) main_file, that column is considered to be a foreign column.

The Foreign_Field_Options property allows you to apply foreign field options to groups of foreign table columns. The Foreign_Field_Option property allows you to assign additional item options to individual foreign columns.

Foreign columns are grouped into 3 different types:

Type Description
DD_KeyField Columns that are key columns
DD_IndexField Columns that are part of indexes
DD_Default All other columns (not key and not indexed)

These column types allow you to apply foreign field option settings to groups of columns by type, instead of having to set them individually for each column in a table.

Toggling / Clearing Foreign Field Options

Foreign Field Options can be toggled ON or OFF at the DataDictionary Object (DDO) or class level.

This sample clears all field options:

Set Foreign_Field_Options Field Customer.State to DD_Clear_All_Field_Options

Default Foreign Field Options

Indexed Columns (DD_IndexField) typically have the foreign field options DD_FindReq and DD_NoPut applied to them. This means that any indexed column from this parent table requires that parent records are found (to prevent orphaned records) and that parent records are not changed in a child view.

Set Foreign_Field_Options DD_INDEXFIELD To DD_NOPUT DD_FINDREQ

Default Columns (DD_Default) typically have the foreign field option DD_DisplayOnly applied to them. This means that any non-ky and non-indexed column from this parent table cannot be changed or even entered (it is disabled).

Set Foreign_Field_Options DD_DEFAULT To DD_DISPLAYONLY

See Defining Data Dictionary Foreign Fields Attributes in the Data Dictionary Guide for a conceptual review of Foreign Fields.

See Also

Key Foreign Fields | Indexed Foreign Fields | Default Foreign Fields