Skip to content

New DD Methods

The following methods have been added to the DataDictionary class:

Field_Main_Index is now Obsolete

Prior to VDF8.2, the message Field_Main_Index was used by the DataDictionary and Data_set class to determine the main index for a passed file and field. This method had the drawback that the DDO (or DSO) receiving this message may not be the DDO that owns the file. For example, an Order DD may receive this message asking for the main index for a customer field (where Customer is the parent of Order). When this happens, the Order DD determines the main index for this customer without sending a message to the owner Customer DD. While this method works properly, it causes confusion when you want to augment this method. An augmentation in the parent DD (the owner of the field) will not get called.

It had been suggested that this be improved. We have implemented this improvement by adding the new messages File_Field_Index and Field_Index.

When sending this message, you can use either File_Field_Index or Field_Index. Using File_Field_Index is easier because you do not have to worry that the message is sent to the correct DDO - it will find the owner DDO and send the message Field_Index.

When augmenting this method, always augment Field_Index in the owner DD. You can now be sure that this method will get called.

The packages have all been changed so they no longer call Field_Main_Index. They now call File_Field_Index.

Important Compatibility Note

If you are using Field_Main_Index anywhere in your code, it will still work exactly as before. We strongly encourage you to bring your code up to date. You should search your code and make the following changes:

  1. Search for all occurrences where you call Field_Main_Index and change the name of the call to File_Field_Index.
  2. Search for any occurrences of augmentations of Field_Main_Index (look for function Field_Main_Index) and change it as follows:
// Old pre 8.2 code
function Field_Main_Index integer file integer field returns integer
// should be changed to
function Field_Index integer field returns integer

Notice the name change and the parameter change. Also, make sure that the function is located in the owner DDO.

We do not expect that many developers call Field_Main_Index, and we expect that even fewer developers have augmented this message. If you have augmented the message, you might have already encountered the limitation with Field_Main_Index, and we hope you will welcome this improvement!

Finally, if you are using data_sets instead of DDOs, no change is required. They continue to use the Field_Main_Index method. (Of course, you want to use DDOs.)