ImageWIKI
RSS

Navigation



Tags
1_2 2011 4_0 4_1 4_1_0_10 4_1_0_11 4_1_0_9 4_2 4_2_0_0 4_2_0_1 4_2_0_5 Android BlackBerry CRM 3_0 CRM 4_0 CRM Online Default Sales Profile Exchange Connector FAQ General Guides HOWTO Installation iPhone KB Mobile Express Private Sample SDK Server TODO troubleshooting Windows Mobile

Other Links
CWR Mobility Website
CWR Mobility Blog




Quick Search » Advanced Search »

PoweredBy
This article applies to:
  • CWR Mobile CRM 4.2 Windows Mobile


Form Life Cycle

During the form life cycle there are various points where the SDK can integrate.

Open Form

Process is initiated by calling PanelStack.OpenForm
  1. GetFormPanel from cache
    1. If not in cache
      1. Create Instance
      2. Instantiate Controls
        1. Create Instance
        2. IFormControl.Configure
        3. Add to form
    2. Return instance
  2. NavigateTo is called on the PanelStack
    1. Call Event PanelStack.OnPanelChanging on the previous panel.
      • If the event Cancel propery is set to true abort
    2. Hide previous panel this triggers the CwrPanel.HidePanel Event
      • If the event Cancel propery is set to true abort
    3. Call CwrPanel.SaveState() on the previous panel
      • For each control on the form call IFormControl.SaveState()
    4. Configuration Callback passed to the NavigateTo method. For the form this is FormPanel.Configure()
      1. Set ObjectID
        • If the object ID has a value then retrieve entity from database
        • If the object ID has no value but the parent entity is set create the entity from the mapping
        • Else use a blank entity
      2. Trigger the IFormPanel.SourceRecordChanged event
      3. If default values are supplied call FormPanel.SetValue for each value, this will Fire the IFormContext.OnFormChanged event for each value
      4. Call CwrPanel.ShowPanel
        1. Fire the IFormContext2.FormShow event

Navigating back to a form

If the user closes a panel and the previous item was a form the state of the form is restored. This is initiate by calling the NavigateBack method on the Panelstack. The following procedure is valid if the previous panel is a standard Form Panel.

  1. On the currently showing panel fire the PanelStack.OnPanelChanging event
    • If the event Cancel propery is set to true abort
  2. On the currently showing panel call the CwrPanel.HidePanel method. If the previous panel is a Form panel and field values have change a warning dialog will be shown to the user, allowing the user to cancel the operation.
    • If the event Cancel propery is set to true abort
  3. On the previous panel call CwrPanel.LoadState()
    1. Restore the for state
    2. For each control on the from call IFormControl.LoadState()
  4. On the previous panel fire the CwrPanel.ShowPanel event
    1. If another form panel for this record was opened and this record was changed a notification will ask the user if the form should be reloaded.
      • When reloading the record it will be retrieved from the database and the IFormContext2.SourceRecordChanged event will be triggered
    2. Fire the IFormContext2.FormShow event

Save Operation

These operations are performed when the record is saved.

  1. Validate the form fields
    1. For each control call the IFormControl.Validate method. When this method returns false the error message is shown in a textbox and the Save is aborted.
  2. Fire the IFormContext2.FormSave event
  3. Create or update the record
    • The Pre and Post Callouts are called here.
  4. Fire the IFormContext2.FormSaved event
  5. If needed reload the record. (The reload will not occur if the SaveAndClose or SaveAndNew method was called)
    1. Retrieved it from the database
    2. Fire the IFormContext2.SourceRecordChanged event

ScrewTurn Wiki version 3.0.4.560. This Wiki contains 108 pages.