template_banner.gif Main Index  PREV  NEXT

Valid HTML 4.01!   Valid CSS!

Update / Modify Forms

Update 1 - update a single occurrence

CT_UPDATE1.gif

Description

This type of form is used to modify the contents of an entity. Only one occurrence can be modified with each operation of this form.

Upon initial entry there will be an automatic retrieve of the relevant occurrence using the primary key value passed down from the parent form. The user changes the relevant data, then presses the OK button to update and exit.

Buttons

OK Will commit any outstanding changes to the database, send a message to the parent form, then exit.
CANCEL Will abandon the current entry and exit.
STORE Will commit any outstanding changes to the database, send a message to the parent form, but will not exit.

Contents

Bound Objects

Source Entity Source Field Target Entity Target Field
ACTION_BAR CANCEL ACTION_BAR CANCEL
  OK   OK
  STORE   STORE
MAIN FIRST    
  LAST    

Local Constants (Refer to Local Constants)

Name Expression Description
FORM_VERSION 01.000.000 To be incremented each time the component is changed.

Component Variables (Refer to Component Variables)

Name Description
FORM_VERSION  
PARAMS  

Update 2 - update Control records

CT_UPDATE2.gif

Description

A lot of applications require some sort of control record which contains a series of settings which can be modified by the user to determine various options. This is usually implemented as a single record containing a separate field for each individual setting. With this structure it is not very easy to add extra settings as the record layout would have to be modified, and all forms referencing this layout would have to be recompiled.

An alternative and much more flexible approach would be to hold each setting on its own record rather than all settings on a single record. This can be achieved with a record layout containing just two columns - FIELDNAME (primary key) and FIELDVALUE. In this implementation I have added an additional field called RECORD_ID to the primary key so that field names can be grouped together for different purposes. It would therefore be possible to have different versions of this component which could contain different sets of fieldnames and values.

This type of form is used to modify the contents of these control records. If any field painted on the form has a name which appears as FIELDNAME on a control record then it is automatically loaded with the corresponding value. When writing to the database if any field on the form does not currently have a corresponding control record then one will automatically be created. This effectively allows new fields to be added to the control record without having to alter the structure of the database. The only form that needs to be recompiled is the form that references the new field.

As this entity is independent of all other entities this is a modal form. Once activated it will not be possible to switch focus to any other form.

Upon initial entry the existing values for the specified RECORD_ID will be automatically retrieved. The user changes the relevant data, then presses the OK button to update and exit.

Buttons

OK Will commit all outstanding changes to the database, then exit.
CANCEL Will abandon all outstanding changes and exit.

Contents

Bound Objects

Source Entity Source Field Target Entity Target Field
ACTION_BAR CANCEL ACTION_BAR CANCEL
  OK   OK
DUMMY FIRST    
  LAST    
CONTROL N/A   N/A

Local Constants (Refer to Local Constants)

Name Expression Description
FORM_VERSION 01.000.000 To be incremented each time the component is changed.
RECORD_ID   Provides the RECORD_ID to be used when retrieving records from the CONTROL table.

Component Variables (Refer to Component Variables)

Name Description
FORM_VERSION  
LIST An associative list built up using a series of 'fieldname=value' entries.

copyright.gif http://www.tonymarston.net