Parameter | Description |
---|---|
iField | Number of the column in the table |
Property Integer Foreign_Field_Options
Read Access: | Get Foreign_Field_Options iField to IntegerVariable |
Write Access: | Set Foreign_Field_Options iField to IntegerVariable/Value |
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) |
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
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.
Key Foreign Fields | Indexed Foreign Fields | Default Foreign Fields