This page is a Draft, its content is not complete and might contain errors.
EditIFormContext
The
IFormContext interface provides the custom control access to event which occur at various stages of a forms life cycle. The following events are available:
| FormCreated | Occurs when a form instance and all the controls have been created. Note: forms are cached, a new instance will only be created the first time the form is requested or after the form has been changed by a synchronization. |
| DataLoaded | Occurs when data has been loaded onto the form. |
| FormLoaded | Occurs whenever the object ID of the record is changed and the form fields are ready (field values or defaults have been loaded). This typically is when the form is shown or on a refresh (e.g. after a save or when the refresh menu item is clicked) and occurs for both new and existing records. |
| FormShow | This is the last event that is triggered prior to the UI being released to the user. |
| FormSave | Occurs after the form validation but before the actual save event. This event still occurs if no changes were made. Note: Available from version 4.0.0.7 and up. |
| FormSaved | Occurs after the record is actually saved to the database. This event does not occur if no changes were made. |
| FormChanged | Occurs whenever a field on the form changes. Note: prior to version 4.1.0.1 this event could also fire during while data was being loaded from the database. |
| FormClosed | Occurs when the form is being closed |
EditICustomControl
The methods on the custom control interface are called part of the form life cycle.
| Configure | Called after the control has been created prior to the IFormContext.FormCreated event. |
| Clear | Called when the Object Id of the controls is changed. |
| SetDefault | Called after Clear when the form is shown for a new record |
| SetState | For existing records called after clear and before the IFormContext.DataLoaded event. Note: this method may be called multiple times. For new records called after SetDefault and before the IFormContext.FormLoaded event. |
| Validate | Called after a save is requested but before the IFormContext.FormSave event. |
EditBackwards navigation & Form Caching
When a user navigates from an existing record to a related record of the same type some special considerations apply. This can for example occur if the user opens a lookup or opens a record through a related view.
When the user navigates forward the following will occur:
- Values from the fields are saved
When the user navigates backwards the following will occur:
- For existing records the record is reloaded from the database. This will trigger the DataLoaded.
- The FormLoaded event is triggered
- Values are restored to the form fields. This will trigger FormChanged events
See Also