Skip to content

Allow_Foreign_New_Save_State - DataDictionary

Allows saving of a new record when a table is being used as a foreign table

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

Syntax

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

Description

Allow_Foreign_New_Save_State allows saving of a new record when the table is being used as a foreign table (e.g. related parent or grandparent) in a component (e.g. dbView). This property has been created to provide a proper solution to saving new parent records within a DDO structure.

Set this property to True inside of your DataDictionary Object (DDO) (not class) in order to be able to save a new record when the table is being used as a foreign table in the view.

Normally, a DDO parent table (e.g., the customer parent DDO in an order entry view) is foreign and will have Foreign_Field_Options applied to it. Setting this property to true instructs the DDO columns in this table should not be treated as foreign. This makes it possible to save a new parent record while you are saving a new main (child) record.

For example, you may have an order entry system that allows you to create and save a new customer at the same time you are creating and saving a new order. Normally the customer in an order view is foreign. Typical foreign settings would make most columns display-only and key columns find-required. This would make it impossible to enter new customer data and, if the customer id is system generated, you would encounter a find required error when you attempt to save the order. If you set the customer DDO's Allow_Foreign_New_Save_State True, the DDO would not be treated as a foreign column. This would allow you to save the new parent.

In addition, foreign columns do not have default values applied to them when they are cleared. In the above example, your new (parent) customer would not have proper defaults set when you tried to save it. Setting Allow_Foreign_New_Save_State to True, will cause defaults to be applied - a desired behavior when saving a new parent.

Sample

Set Allow_Foreign_New_Save_State to True