Table of Contents

Module to Support Editing of Texts based on Codetable

Module CODMOD Module to Support Editing of Texts based on Codetable

Description

The purpose of this module is to handle language specific
descriptions to a field. The description are automatically loaded in all
defined UIL-Languages.
The Module supplies:
1. a panel to display and enter the descriptions
2. logic to load the descriptions on changes of the field
3. logic to store the descriptions in the CodeTable system
The module is supported by the moduleset MDxBUT.
Usually the module is used in the xxxP-module. The panel is placed
on the editing panel.
The INR argument is directly linked to the INR of the record holding
the dataset of the field.
The COD argument holds the fieldname as a literal string where the
descriptions are linked to.


Handling the Description of coded Fields (CODMOD)

The purpose of this module is to enable the easy and error-free handling of the descriptions of codes used in database entries.

The module supplies the following functionality:

The MDxBUT set of modules fully supports CODMOD.

In order to maintain the description in the masterfile maintenance, the following steps are to be taken:

The field reference might either be absolute or relative. Any relative reference is located relative to the module holding the specified INR field. The normal usage is to use the fieldname in the record as fieldname, as the fields to be decoded are usually located in the same record as the INR.

When using an absolute reference it should be checked, that every usage of this CODMOD instance will be able to access the requested field via this reference.

In case additional codetables of a field are handled via module CODMOD, CODMOD will write these data in a specific section of file SYSDBA.INI. Thus, these tables are available for maintenance and check functions.

Properties

Property YES/NO
Single page frame No
Show toolbar No
Show menu No
Show statusbar No
Show hint No
Fit panel size No



Datafields

Name Description Data Type Len Dec. View lines View type Inst. Visible Codetable
COD Code to be handled as Constant Name Text 40 1 Edit No Public
INR INR of handled Record Text 8 1 Edit No Public
PANSTA Panelstatus of owning Panel Text 1 1 Edit No Public
CODTBL Name of Codetable (optional) Text 6 1 Edit No Public
TBLUSE Used CodeTable Text 6 1 Edit Yes Read only
FLDUSE Used Field reference Text 40 1 Edit Yes Read only
FLDCOD Value of Code of loaded Longtexts Text 6 1 Edit Yes Read only
CODNAM Decoded Longtext of Cod Text 80 1 Edit Yes Read only
NOTUNIFLG Don't check for unique long text Text 1 1 Edit Yes Public



Datafield Description and Properties

Datafield COD Code to be handled as Constant Name

Description

The fieldname of the codefield has to be passed as a string constant. The passed name should be the absolute or relative fieldname of the Codefield the descriptions are associated to. Any relative reference is located relative to the module holding the INR-field specified.


Datafield INR Internal Unique ID

Description

INR-field of the record holding the codefield the descriptions are associated to. The argument logically links the descriptions to the record.

Helpinformation

Unique internal ID of a record within the table. The INR is a text field, which is created by retrieving the next valid entry from the counter of this table. The field INR is used to enable links from other tables to this table.

For contractdata the INR also links the two tables xxD and xxT as associated entries hold the same INR.


Datafield PANSTA Panelstatus of owning Panel

Description

The PANSTA of the owning panel has to be linked into CODMOD to handle the local panel correct.


Datafield CODTBL Name of Codetable (optional)

Description

This field may optionally hold the name of the codetable to be used. If this field is empty, the codetable associate to the field named in COD is used. This field is usually empty. Otherwise it has to be set via a constant argument.


Datafield TBLUSE Used CodeTable

Description

During init the codetable used is evaluated and stored for further reference.


Datafield FLDUSE Used Field reference

Description

During init the field holding the code to be used is evaluated and stored for further reference. This field holds an absolute reference.


Datafield FLDCOD Value of Code of loaded Longtexts

Description

This field holds the codevalue the currently loaded longtexts are associated to.


Datafield CODNAM Decoded Longtext of Cod

Description

This field holds the longtext of the currently loaded codevalue in user interface language. Intended usage is to build the OBJNAM of the current entry.


Datafield NOTUNIFLG Don't check for unique long text

Description

Any non blank contents suppresses the automatic check for unique long texts, which is otherwise automatically executed. This field is usually set in the init of the module which uses codmod.


Panels

Panel Type Description
CODTXTP FramePanel Description



FramePanel CODTXTP

Properties
Property Value
Width 352
Height 145
Popup position-X 0
Popup position-Y 0
Visible No
Read only Yes
Show toolbar No
Instanciated No
Popup panel No
Global No



Rules

Rule Name Additional
check CODTXT\NAM
check INR
default CODNAM
default CodTable
event CODTXT\NAM
function CodGetDefNam text
function CodGetText text method
init
sub CodClearTxt method
sub CodDeleteTxt method
sub CodLoadTxt method
sub CodSaveTxt method
sub CodSptLoadTxt method
sub CodSptSaveTxt method



Rules Description and Comments

check CODTXT\NAM

Checks if length of text is lesser then specified length
Check if text is already defined for an other code


default CODNAM

Defaultrule to load the decoded longtext of the currently loaded codevalue


default CodTable ( CODTXT, FLDCOD )

Default to load the Grid holding the longtexts and the local copy of the Codevalue.


event CODTXT\NAM

Rule to trigger any redefaulting when changing the longtext in CODMOD


function CodGetText( in ArgCod text, in ArgUil text ) : text method

Returns the longtext of the passed code in the passed UIL.
This routine uses the associated code table if the code is the
currently loaded code or the current content of CODMOD.


Modules

Module class Instance Comment
STH STH
CODTXT CODTXT