File_Field_Default_AutoFind - DataDictionary
Performs an AutoFind on a foreign table column without setting the DDO's Changed_State to True
Type: Procedure
Parameters
| Parameter | Type | Description |
|---|---|---|
| iFile | Integer | Number of table in current filelist |
| iField | Integer | Number of column iField in the table |
Syntax
Procedure File_Field_Default_AutoFind Integer iFile Integer iField
Call Example
Send File_Field_Default_AutoFind iFile iField
Description
File_Field_Default_AutoFind performs an AutoFind on a foreign table column in "default" mode. This is similar to the File_Field_Autofind method except that it does not set the DataDictionary object's (DDO's) Changed_State to True.
When a normal AutoFind is performed on a parent table (e.g. a Customer table for an Order), the main DDO's Changed_State is set to True because a new parent has been changed. A "default" AutoFind does not set this Changed_State, which avoids the generation of a data-loss warning.
This method should be used to perform an AutoFind as part of setting defaults, to default parent table records. It will often be used inside of a DDO's Clear and Clear_All method and will be used in conjunction with retained column values.
Send File_Field_Default_AutoFind of hDD iFile iField
Send File_Field_Default_AutoFind of hDD File_Field FileName.FieldName
Sample
Adding the following code to the order view in the OrderHea DDO will cause the customer key column to be retained and auto-found.
Set File_Field_Option File_Field Customer.Customer_Number to DD_Retain
// augment clear so that it performs an autofind for the customer. The
// retained data will be used to perform this autofind
Procedure Clear
Forward Send Clear
Send File_Field_Default_AutoFind File_Field Customer.Customer_Number
End_Procedure
Notes
This method should only be used when a DDO is not busy (i.e. when Operation_Mode is Mode_Waiting). This method cannot be used inside of Field_Defaults.
See Also
Changing Field Properties within a DD Object | Retains with Parent Fields