Skip to content

Key Foreign Fields

A Key field, DD_KEYFIELD, is any field for which the Key_Field_State property is set to true. When used as foreign fields, you will usually want these fields to be find-required, auto-find, and no-put. This means that a parent record must be found before the main (child) record can be saved, that if you enter a value in the field, an auto-find will occur, and that you cannot change this key value. The foreign field settings for this will be:

Set Foreign_Field_Option DD_KEYFIELD DD_NoPut to True
Set Foreign_Field_Option DD_KEYFIELD DD_FindReq to True

Often, the key field’s main field options have already specified auto-find and no-put. Because these standard field options are added to the foreign field options, you may only need to set the following:

Set Foreign_Field_Option DD_KEYFIELD DD_FindReq to True

See Also