Image CWR Mobility Wiki
This page is a Draft, its content is not complete and might contain errors.

This article applies to:
  • CWR Mobile CRM 4.0/4.1

Edit

IFormContext

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:

FormCreatedOccurs 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.
DataLoadedOccurs when data has been loaded onto the form.
FormLoadedOccurs 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.
FormShowThis is the last event that is triggered prior to the UI being released to the user.
FormSaveOccurs 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.
FormSavedOccurs after the record is actually saved to the database. This event does not occur if no changes were made.
FormChangedOccurs 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.
FormClosedOccurs when the form is being closed

Edit

ICustomControl

The methods on the custom control interface are called part of the form life cycle.

ConfigureCalled after the control has been created prior to the IFormContext.FormCreated event.
ClearCalled when the Object Id of the controls is changed.
SetDefaultCalled after Clear when the form is shown for a new record
SetStateFor 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.
ValidateCalled after a save is requested but before the IFormContext.FormSave event.

Edit

Backwards 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:
  1. Values from the fields are saved

When the user navigates backwards the following will occur:
  1. For existing records the record is reloaded from the database. This will trigger the DataLoaded.
  2. The FormLoaded event is triggered
  3. Values are restored to the form fields. This will trigger FormChanged events

See Also

ScrewTurn Wiki version 2.0.35. This Wiki contains 64 pages.