Home | Products | Downloads | Buy License | Support | References | About Xetrion

How does Xetrion Counter Manager work?

Xetrion Counter Manager consists of a set of design elements which you can include in any database.

To use sequential numbering in a database containing Xetrion Counter Manager you

  • define one or more counter classes by using the setup dialog.

    A counter class defines the type, format and numbering algorithm of a counter.

  • call a counter function from any LotusScript code to get the next number for a counter class.

    This function uses a counter class name as input and returns a number string or a formatted counter string depending on the counter type.

Counter types

Xetrion Counter Manager supports two types of counters:

  • Sequential Number
    This type is for a simple sequential number starting at a predefined value. Every time the counter function is called, a predefined step value is added to the current counter value and this new number is returned.
  • Formatted string

    A formatted counter string contains a sequential number, fixed strings and variable parameters (e.g. the current year, document fields).

    Formatted counter strings can count separately for each combination of parameters contained in the counter string (see example below).

    For this counter type Xetrion Counter Manager stores the current sequential number separately for each combination of the number sensitive parameters. In this case one counter class is in fact a collection of many separate counters. To increase the performance of accessing these counters Xetrion Counter Manager supports indexing algorithm.

    Every time the counter function is called Xetrion Counter Manager searches the counter class for a counter which matches the current number sensitive parameters, adds the step value to the current sequential number of this counter and returns the formatted counter string. If it does not find a matching counter it starts a new counter.

Example

Imagine a "Vacation/Holiday approval" database which uses a counter of type "Formatted string" to give every vacation application a readable unique key of the following format:

<Department>-<Year>-<Sequential number>

where <Year> is the year when the application was created and <Department> is the value of the field "Department" in the application document. The counter counts separately for each combination of <Year> and <Department>.

Examples for valid counter values are (IT and HR are departments):

  • IT-2002-0001
  • IT-2002-0002
  • IT-2003-0001
  • HR-2002-0001

 




 
  © Copyright 2008 by Xetrion - All rights reserved | Terms of Use | Privacy Statement