Difference between revisions of "Auto Values"

From Hornbill
Jump to navigation Jump to search
Line 1: Line 1:
 
__NOTOC__[[Main_Page|Home]] > [[Administration]] > [[Data]] > Auto Values
 
__NOTOC__[[Main_Page|Home]] > [[Administration]] > [[Data]] > Auto Values
 
==Introduction==
 
==Introduction==
The Auto Values feature lets an administrator define how auto-generated values are constructed.
+
The Auto Values feature lets an administrator define how auto-generated values, such as reference IDs, are constructed. Places where more than a sequence number (000001234) is required, an Auto Value can be modified to include dates, time, location, teams, user IDs and more.  There are many situations where this type of sequence is much more preferable over a simple numeric sequences. Some examples include: -
 +
 
 +
* Shipment numbers
 +
* Document or Article Reference Numbers
 +
* Stock Item Codes
 +
* Asset ID's
 +
* Access Code numbers
 +
 
 +
==== Available Auto Value Component Parts ====
 +
The following lists of component parts are available to construct an auto value.
 +
 
 +
{| class="prettytable"
 +
 
 +
|-
 +
!Name
 +
!Description
 +
 
 +
|-
 +
|nowrap="1"|'''seq(''' ''[z]'', ''[radix]'' ''')'''
 +
|A number starting at 1 when the sequence is first used and incremented by one each time the sequence is used and will never be reset for the entire life of the sequence.
 +
*The 'z' parameter is optional but if specified indicates the number of leading zero's to display, if not specified then ZERO is assumed.  If the number of digits in the resultant value exceeds the number of places defined here, then the left-most digits will be discarded. 
 +
*The 'radix' parameter allows you to specify the base to use when converting the numeric value to a string. The default value if not specified is ten (10), any value between 2 and 36 is valid.
 +
 
 +
|-
 +
|nowrap="1"|'''seqd(''' ''[z]'', ''[radix]'' ''')'''
 +
|A number starting at 1 at the beginning of each day, and incremented by one each time the sequence is used. This is the daily incremental value for this specific sequence instance. See the component 'seq' for and explanation of the optional 'z' and 'radix' parameters.
 +
 
 +
|-
 +
|nowrap="1"|'''seqm(''' ''[z]'', ''[radix]'' ''')'''
 +
|A number starting at 1 at the beginning of each month, and incremented by one each time the sequence is used. This is the monthly incremental value for this specific sequence instance. See the component 'seq' for and explanation of the optional 'z' and 'radix' parameters.
 +
 
 +
|-
 +
|nowrap="1"|'''seqy(''' ''[z]'', ''[radix]'' ''')'''
 +
|Will be translated into a number starting at 1 at the beginning of each year, and incremented by one each time the sequence is used. This is the yearly incremental value for this specific sequence instance. See the component 'seq' for and explanation of the optional 'z' and 'radix' parameters.
 +
 
 +
|-
 +
|nowrap="1"|'''date(''' ''[part]'' ''')
 +
|This function will be translated into the date/time a component of the current date/time based on the analysts current time zone settings.  The parameter 'part' is optional, the following are possible: -
 +
 
 +
:{| class="prettytable"
 +
 
 +
|- bgcolor="#e0e0e0"
 +
|Part
 +
|'''Description'''
 +
 
 +
|-
 +
|nowrap="1"|''not specified''
 +
|The current date/time format defined for the current session
 +
 
 +
|-
 +
|nowrap="1"|'''year'''
 +
|The current four-digit year (e.g. 2008)
 +
 
 +
|-
 +
|nowrap="1"|'''year2'''
 +
|The current two-digit year (e.g. 08)
 +
 
 +
|-
 +
|nowrap="1"|'''month'''
 +
|The current two-digit month (01-12)
 +
 
 +
|-
 +
|nowrap="1"|'''day'''
 +
|The current two-digit day of the month (01-31)
 +
 
 +
|-
 +
|nowrap="1"|'''hour'''
 +
|The current two-digit hour (00-23)
 +
 
 +
|-
 +
|nowrap="1"|'''hour12'''
 +
|The current two-digit hour (01-12)
 +
 
 +
|-
 +
|nowrap="1"|'''min'''
 +
|The current two-digit minute (00-59) at the point in time of invocation based on the analysts current time zone settings
 +
 
 +
|-
 +
|nowrap="1"|'''sec'''
 +
|The current two-digit second (00-59) at the point in time of invocation based on the analysts current time zone settings
 +
 
 +
|}
 +
 
 +
 
 +
|-
 +
|nowrap="1"|'''udate(''' ''[part]'' ''')
 +
|This function will be translated into the date/time a component of the current date/time based on UTC.  The parameter 'part' is optional, the following are possible: -
 +
 
 +
:{| class="prettytable"
 +
 
 +
|- bgcolor="#e0e0e0"
 +
|Part
 +
|'''Description'''
 +
 
 +
|-
 +
|nowrap="1"|''not specified''
 +
|The current UTC time in ISO8601 date/time format
 +
 
 +
|-
 +
|nowrap="1"|'''year'''
 +
|The current four-digit year (e.g. 2008)
 +
 
 +
|-
 +
|nowrap="1"|'''year2'''
 +
|The current two-digit year (e.g. 08)
 +
 
 +
|-
 +
|nowrap="1"|'''month'''
 +
|The current two-digit month (01-12)
 +
 
 +
|-
 +
|nowrap="1"|'''day'''
 +
|The current two-digit day of the month (01-31)
 +
 
 +
|-
 +
|nowrap="1"|'''hour'''
 +
|The current two-digit hour (00-23)
 +
 
 +
|-
 +
|nowrap="1"|'''hour12'''
 +
|The current two-digit hour (01-12)
 +
 
 +
|-
 +
|nowrap="1"|'''min'''
 +
|The current two-digit minute (00-59) at the point in time of invocation based on the analysts current time zone settings
 +
 
 +
|-
 +
|nowrap="1"|'''sec'''
 +
|The current two-digit second (00-59) at the point in time of invocation based on the analysts current time zone settings
 +
 
 +
|-
 +
|nowrap="1"|'''epoch'''
 +
|The UTC time as a unix EPOCH time which is a positive number representing the number of seconds elapsed since the 1st January 1970 at 12:00.
 +
 
 +
|}
 +
 
 +
 
 +
 
 +
|-
 +
|nowrap="1"|'''uuid(''' ''[type]'' ''')
 +
|This function will be translated into a newly generated UUID.  The parameter 'type' is optional, the following are possible: -
 +
 
 +
:{| class="prettytable"
 +
 
 +
|- bgcolor="#e0e0e0"
 +
|Type
 +
|'''Description'''
 +
 
 +
|-
 +
|nowrap="1"|''normal''
 +
|This generates a UUID that is unique to the system its being generated on
 +
 
 +
|-
 +
|nowrap="1"|''secure''
 +
|This generates a UUID that cannot be traced to the ethernet address of the computer on which it was generated
 +
 
 +
|-
 +
|nowrap="1"|''not specified''
 +
|The same as 'normal'.
 +
 
 +
|}
 +
 
 +
|-
 +
 
 +
 
 +
The 'pad' parameter allows you to define leading zero padding for the number generated. For example, if you specify a pad of 3 for the resultion mM then the nuber generated would be 000-999 (note the leading zero's).  This is typically used to create fixed width text representations of the generated number.  For example, if you need a high-resolution part for an ISO8601 formatted date/time value, you would need to pad the high res part, so to illustrate the following two timestamps  20110101T123344.14Z and 20110101T123344.0014Z mean differnt things. Its critical that the high res part is padded with leading zeros in order to hold the correct meaning of each decimal place.
 +
 
 +
|-
 +
|nowrap="1"|'''sess( ''prop_name'' )'''
 +
|The current user’s session property.
 +
 
 +
|-
 +
|nowrap="1"|'''param(''param_name'')'''
 +
|A value passed into the function when invoking the sequence.  A sequence that includes this component can not be auto-bound to a table for automatic sequence generation.  If the sequence is used for this purpose, any record insert will fail as the sequence will throw an error
 +
 
 +
|-
 +
|nowrap="1"|'''rec( ''column_name'' )'''
 +
|will be translated into the value that will be written to the database record.  A sequence that includes this component can only be auto-bound to a table and can not be used through a call to the '''data::sequenceComplexGetNext''' API. If it is called directly via the API the sequence will contain "??" in the place where the specified record value should be
 +
 
 +
|}
  
 
== Options ==
 
== Options ==

Revision as of 16:30, 20 February 2015

Home > Administration > Data > Auto Values

Introduction

The Auto Values feature lets an administrator define how auto-generated values, such as reference IDs, are constructed. Places where more than a sequence number (000001234) is required, an Auto Value can be modified to include dates, time, location, teams, user IDs and more. There are many situations where this type of sequence is much more preferable over a simple numeric sequences. Some examples include: -

  • Shipment numbers
  • Document or Article Reference Numbers
  • Stock Item Codes
  • Asset ID's
  • Access Code numbers

Available Auto Value Component Parts

The following lists of component parts are available to construct an auto value.

The 'pad' parameter allows you to define leading zero padding for the number generated. For example, if you specify a pad of 3 for the resultion mM then the nuber generated would be 000-999 (note the leading zero's). This is typically used to create fixed width text representations of the generated number. For example, if you need a high-resolution part for an ISO8601 formatted date/time value, you would need to pad the high res part, so to illustrate the following two timestamps 20110101T123344.14Z and 20110101T123344.0014Z mean differnt things. Its critical that the high res part is padded with leading zeros in order to hold the correct meaning of each decimal place.
Name Description
seq( [z], [radix] ) A number starting at 1 when the sequence is first used and incremented by one each time the sequence is used and will never be reset for the entire life of the sequence.
  • The 'z' parameter is optional but if specified indicates the number of leading zero's to display, if not specified then ZERO is assumed. If the number of digits in the resultant value exceeds the number of places defined here, then the left-most digits will be discarded.
  • The 'radix' parameter allows you to specify the base to use when converting the numeric value to a string. The default value if not specified is ten (10), any value between 2 and 36 is valid.
seqd( [z], [radix] ) A number starting at 1 at the beginning of each day, and incremented by one each time the sequence is used. This is the daily incremental value for this specific sequence instance. See the component 'seq' for and explanation of the optional 'z' and 'radix' parameters.
seqm( [z], [radix] ) A number starting at 1 at the beginning of each month, and incremented by one each time the sequence is used. This is the monthly incremental value for this specific sequence instance. See the component 'seq' for and explanation of the optional 'z' and 'radix' parameters.
seqy( [z], [radix] ) Will be translated into a number starting at 1 at the beginning of each year, and incremented by one each time the sequence is used. This is the yearly incremental value for this specific sequence instance. See the component 'seq' for and explanation of the optional 'z' and 'radix' parameters.
date( [part] ) This function will be translated into the date/time a component of the current date/time based on the analysts current time zone settings. The parameter 'part' is optional, the following are possible: -
Part Description
not specified The current date/time format defined for the current session
year The current four-digit year (e.g. 2008)
year2 The current two-digit year (e.g. 08)
month The current two-digit month (01-12)
day The current two-digit day of the month (01-31)
hour The current two-digit hour (00-23)
hour12 The current two-digit hour (01-12)
min The current two-digit minute (00-59) at the point in time of invocation based on the analysts current time zone settings
sec The current two-digit second (00-59) at the point in time of invocation based on the analysts current time zone settings


udate( [part] ) This function will be translated into the date/time a component of the current date/time based on UTC. The parameter 'part' is optional, the following are possible: -
Part Description
not specified The current UTC time in ISO8601 date/time format
year The current four-digit year (e.g. 2008)
year2 The current two-digit year (e.g. 08)
month The current two-digit month (01-12)
day The current two-digit day of the month (01-31)
hour The current two-digit hour (00-23)
hour12 The current two-digit hour (01-12)
min The current two-digit minute (00-59) at the point in time of invocation based on the analysts current time zone settings
sec The current two-digit second (00-59) at the point in time of invocation based on the analysts current time zone settings
epoch The UTC time as a unix EPOCH time which is a positive number representing the number of seconds elapsed since the 1st January 1970 at 12:00.


uuid( [type] ) This function will be translated into a newly generated UUID. The parameter 'type' is optional, the following are possible: -
Type Description
normal This generates a UUID that is unique to the system its being generated on
secure This generates a UUID that cannot be traced to the ethernet address of the computer on which it was generated
not specified The same as 'normal'.
sess( prop_name ) The current user’s session property.
param(param_name) A value passed into the function when invoking the sequence. A sequence that includes this component can not be auto-bound to a table for automatic sequence generation. If the sequence is used for this purpose, any record insert will fail as the sequence will throw an error
rec( column_name ) will be translated into the value that will be written to the database record. A sequence that includes this component can only be auto-bound to a table and can not be used through a call to the data::sequenceComplexGetNext API. If it is called directly via the API the sequence will contain "??" in the place where the specified record value should be

Options

  • Name
  • Description
  • Auto Value Components
  • seq(z,r)
  • seqd(z,r)
  • seqm(z,r)
  • seqy(z,r)
  • date()
  • udate()
  • uuid()
  • sess(name)
  • param(name)
  • rec(name)
  • Current Value
  • Daily Increment
  • Monthly Increment
  • Yearly Increment
  • Time Last Generated