Requirements for Saves
The Data Dictionary Object structure requirement for a save is simple. Every required parent table defined in the DDO (with the Add_Server_File method) must be represented as a DDO in the object structure and must be properly connected (with the DDO_Server property). The following code snippets show a Data Dictionary class and a valid DDO structure that would allow saves.
Procedure Construct_Object
Forward Send Construct_Object
Set Main_File to Orderhea.File_Number
:
Set Add_Server_File to Customer.File_Number
Set Add_Server_File to SalesP.File_Number
Set Add_Client_File to Orderdtl.File_Number
End_Procedure
Object oCustomer_DD is a Customer_DataDictionary
End_Object // oCustomer_DD
Object oSalesp_DD is a Salesp_DataDictionary
End_Object // oSalesp_DD
Object oOrderhea_DD is a Orderhea_DataDictionary
Set DDO_Server to oCustomer_DD
Set DDO_Server to oSalesp_DD
End_Object // oOrderhea_DD
This is a simple case. If either of the parent DDOs had required parents, those DDOs would also have to be present before a save would be allowed. For example, assume that the Customer Data Dictionary was defined as follows:
// Construct_Object in the customer DD class
Procedure Construct_Object
Forward Send Construct_Object
Set Main_File to Customer.File_Number
:
Set Add_Server_File to Region.File_Number
End_Procedure
The DDO structure listed above is now incomplete. It is incomplete for Customer and therefore it is incomplete for OrderHea. Saves would not be allowed in either DDO. A proper DDO structure for this would now need to be:
Object oRegion_DD is a Region_DataDictionary
End_Object // oRegion_DD
Object oCustomer_DD is a Customer_DataDictionary
Set DDO_Server to oRegion_DD
End_Object // oCustomer_DD
Object oSalesp_DD is a Salesp_DataDictionary
End_Object // oSalesp_DD
Object oOrderhea_DD is a Orderhea_DataDictionary
Set DDO_Server to oCustomer_DD
Set DDO_Server to oSalesp_DD
End_Object // oOrderhea_DD
Note that Add_Server_File is used to define a required parent table within a Data Dictionary and that this occurs at the class level. Using DDO_Server actually creates the connection at the object level. Add_Server_File defines the requirement and DDO_Server fulfills the requirement.