Extending Models with Module Defined Fields (MDF)

with the hope that we could foresee the needs of as large an audience as possible. That being said, there is no way we can foresee and cater to the needs of every user in every situation. Module Defined Fields (MDF) allow you to add additional fields to core models in not only your module, but any dependent modules as well. The fields are maintained in files separate from the core models themselves, which protects you from losing changes with future upgrades. The fields are added during the build process.

Procedure 4.18. To Create and Populate an MDF File for Any Given Core Model:

  1. Select File | New | MDF from the main Studio menu.

  2. Select the project to be used by the MDF, then select the core model from the drop down list and click OK.

  3. A new MDF file will be created in the selected projects models folder based on the name of the model you selected. For example, selecting Buffer will create a file called Buffer.mdf.

  4. Double click the MDF to open it for edit.

    You can add and remove fields in the same way you could if you were editing an application model, except that you can't remove or alter field definitions that are intrinsic to the core model itself.

  5. Click the Add button.

  6. Type a name for the field which is unique to the model.

  7. Select the type of data to be used.

  8. Fill in any specific information needed for the type. For example if you select the String type, there are a number of parameters you can fill in such as maximum length. The list of parameters varies by data type. For more details on data types, see section 4.1 of this chapter titled "Defining Fields".

  9. Once you've added your MDF definitions, rebuild your module to see the changes.

Procedure 4.19. To Remove and MDF Field

  • To remove an field from the MDF, simply select it and click delete.