IDAutomation.com, Inc., Computers Hardware, Software & Services, Tampa, FL Contact IDAutomationView your cart in the IDAutomation Store  
Loading
Home > Font Encoders > Barcode Tutorials for Lotus Applications

Lotus Barcode Tutorials

Lotus Notes and Domino LotusScript Barcode Functions

This tutorial is designed for intermediate and advanced Lotus Notes, Domino Designer, Approach and Lotus SmartSuite users. Using the Lotus barcode tutorial, IDAutomation's barcode fonts and LotusScript functions can easily be integrated into Lotus applications.

The macros, functions and LotusScript source code provided in this Lotus Application barcode font encoder tool includes working examples. Free to use with IDAutomation barcode fonts, the LotusScript code has been tested with Lotus Notes and Domino Designer versions 4, 5, 6 and 7 as well as Lotus Approach 9.5 and should be compatible with later versions as easily.

Download the LotusScript Barcode Functions for Lotus Notes and ApproachIDAutomation.com, Inc. is an IBM Business Partner

Other Barcode Tools: Windows DLL | Crystal Reports UFL | Microsoft Office Macros & VBA

Lotus Notes and Lotus Domino Barcode Tutorial

"IDAutomation's barcodes quickly and easily integrated with our Lotus Notes Printing and Reporting Tool called Print Merge Reporter, which allowed us to provide our customers with additional barcode mail merge functionality, as well as displaying barcodes in Notes views." - Lance Zakin, Certified Lotus Professional, IVE Technologies, http://www.ivesco.com

The appropriate barcode font must be installed as specified in the field before the Lotus application can properly generate barcodes for display or printing. The Lotus Notes download package database was created in Lotus Notes 4.x. The Code 39 barcode fields in this database are calculated for display because they are the easiest to format. Lotus Notes barcodes can be created from data fields using the following methods.

Using a Formula with Self-Checking Barcode Fonts

This is by far the easiest method for creating barcodes in Lotus Notes, and the self-checking fonts available to use are Code39, Codabar and Industrial Code 2 of 5. To display a barcode, simply create a field computed for display that combines the start and stop characters with the field. For instance, for Code39, the field formula would be: "*" + DataField + "*"

To Display a Barcode, Create a Field That Combines the Start and Stop Characters with the Data-To-Encode.

Choose the barcode font of choice for the field and make sure it is centered in the box with some white space before and after the barcode. The resulting barcode should return an accurate scan.

Using LotusScript to Generate Barcodes in Lotus Notes and Domino

This method is recommended for advanced developers of Lotus Notes or Domino applications. Code 128 and other more complicated barcodes require a LotusScript event and a LotusScript function. See the Lotus script in the barcode database example for an illustration of how to implement these barcodes. In this database example, the LotusScript code that formats the Code 128 field is located in the form's QuerySave Event. In this example, the LotusScript for the function that formats the text to the barcode font is Code128b. This script is located in the form's Globals definition and must be imported from IDAutomation's LotusScript Functions file.

  • Lotus Notes 4.5: Copy and paste only the necessary functions, because this version is limited in terms of the number of functions allowed in the field.
  • Lotus Notes 7: Right-click and select Import, then select the IDAutomationLS.lss file located in the LotusScript download.
Import the LotusScript Barcode Functions into the Form
  1. Open the IDAutomationLS.lss file with a text editor. Copy everything at the top of the file in the declarations section, into the declarations event.
  2. Copy only the necessary functions from the IDAutomationLS.lss LotusScript file into the Options event. The functions will appear as an event in (Globals).
Paste LotusScript Barcode Functions into the Form

Please note that some functions require other functions in order to work properly, and some require an additional argument. Every time the document is edited, the field will be updated. After the field is updated, it may be used on forms and in views with the appropriate barcode font selected.

Adding the LotusScript Source Code for the QuerySave Event

This LotusScript barcode source code performs the following:

  1. Retrieves the appropriate data field.
  2. Calls the function to format the barcode.
  3. Saves the result to a field on the form during the save process.

LotusScript Source Code for the QuerySave Event

For example:

Sub Querysave(Source As Notesuidocument, Continue As Variant) 
  Dim uiDoc As NotesUIDocument
  Dim uiWorkspace As New NotesUIWorkspace
  Set uiDoc = uiWorkspace.CurrentDocument
  'call the function to format the data from field SSN and save it to field Method2SSN
  Call uiDoc.FieldSetText("Method2SSN", Code128(uiDoc.FieldGetText("SSN"),0,0))
End Sub

Choose the correct barcode font for the barcode field and make sure that it is centered in the box with some white space before and after the barcode.

Lotus Approach Barcode Generation Tutorial

The Lotus Approach Barcode Generation Tutorial contains information, examples and steps needed for generating barcodes in Lotus Approach. The appropriate barcode fonts must be installed before the application can display or print barcodes. For environment-specific installation instructions, please refer to these font installation procedures.

Using a Formula with Self-Checking Barcode Fonts

This method of Lotus Approach barcode generation is easiest because it utilizes self-checking fonts such as Code 39 and Codabar. Simply create a field computed for display that combines the start and stop characters with the field. For example, the field formula for a Code 39 font is Combine('*', DataField, '*')

  1. Create a new field in the database where the barcode will be located.
  2. Select Field Properties - Basics - Field Definition - Options.
  3. Enter the formula in the Modification Formula box.
    Enter the Modification Formula for the Barcode Font
  4. Choose the appropriate barcode font for the newly created field, making sure that it is centered in the box with some white space before and after the barcode to ensure a clean scan.
Using LotusScript Functions and Events to Generate Approach Barcodes

Code128, UPC, EAN, Interleaved and other more complex barcode types require a LotusScript event and a LotusScript function in order to work properly. In this database example, the LotusScript that formats the Code128 field is located in the form's Change Event. A separate field must be created that will contain the barcode.

Copying the Barcode Functions into a Database
  1. Open the Lotus Approach database that will contain barcode capability.
  2. Press Ctrl K to open the LotusScript editor.
  3. Select File - Import Script and choose the IDAutomationLS.lss file in the package download. After importing the scripts, several should be listed in the script drop-down box.
    Select File, then Import Script in the LotusScript Editor to Choose the IDAutomation.LS.lss File
  4. Click the Object drop down box and browse to the field that contains the data-to-encode in the barcode.
    In Lotus Approach, the Barcode DataField Contains the Data-To-Encode
  5. Click the script drop-down box and choose Change. Enter the following source code for the change event, changing the function name for the barcode. In this case, the function is Code128b and "DataField" and "BarcodeField" should be changed to the names of the fields in the database.
    LotusScript Source Code for the Barcode Field Change Event.
  6. Select File - Save Scripts and return to the database file.
  7. Choose Design and select the barcode field, named BarcodeField in this case.
  8. Select the appropriate barcode font beginning with IDAutomation to display the barcode. Make sure it is centered in the box with some white space before and after the barcode to ensure an accurate scan.

This field now contains the data formatted to the barcode font, and the data from this field can be used in a mail-merge to create barcodes in Lotus Word Pro. This field can also be used to display barcodes in forms, reports, envelopes, labels and letters. When entering the data, the barcode field automatically update after a tab to the next field. Press CTRL R to refresh or save the database.

Available LotusScript Barcode Functions

These functions are supplied in the IDAutomationLS.lss file, which is provided in the Lotus Script download package. If needed, the IDAutomationLS.lss file may be imported into Lotus Domino Designer 7 as a Shared Script Library. For all functions, the DataToEncode is the string data type. Other data types such as numbers or dates may need to be converted to the string data type for proper encoding.

All parameters are required. For example, use Code128("123456", 0, 1) instead of Code128("123456"). For all number symbologies such as Postnet and UPC, dashes or spaces may be input for easier readability. These characters will be filtered out by the function before the barcode is generated. For UPC-A, UPC-E & EAN-13, the +2 and +5 add-on codes may be created by adding the data to the end of the string.

Function Font Name Function Notes and Additional Information
Code128
(DataToEncode)
(ReturnType)
(ApplyTilde)
IDAutomationC128 This Code 128 Auto function will automatically encode any DataToEncode from ASCII 0 to ASCII 127. Select this function if unsure as to which Code 128 set is used for an application. It will automatically switch to character set C for numbers as well. Data may be easily encoded without any options. For example, the formula Code128("123456") will encode the numbers 123456. It may be necessary to use the ReturnType and ApplyTilde for special purposes.
  • If ApplyTilde is set to True, the tilde will be processed as described here. ApplyTilde is False by default.
  • To encode alpha-numeric UCC/EAN-128, ASCII 202 or character is entered as the FNC1 before each AI. For example, the UCC number of (8100)712345(21)12WH5678 should be entered as:

    81007123452112WH5678

    There is more information available about AIs and UCC/EAN-128 in the Code 128 Barcode FAQ.

    More information about AIs and UCC/EAN-128 is located here.
    (DataToEncode, 0, False) formats barcode output string to the Code 128 barcode fonts.
    (DataToEncode, 0, True) formats barcode output string for the Code 128 barcode fonts with ApplyTilde enabled.
    (DataToEncode, 1, True) returns the human readable text.
    (DataToEncode, 2, True) returns only the check digit.
Code128a
(DataToEncode)
IDAutomationC128 Caution: Entering a lower case character will create a function. Use the character values 64 through 95 from set A to print characters not present on the keyboard. The scanner will recognize these functions as from set A. Formats output to the Code 128 barcode fonts.
Code128b
(DataToEncode)
IDAutomationC128 Returns codes formatted to the Code 128 character set B. Formats output to the Code 128 barcode fonts.
Code128c
(DataToEncode)
(ReturnType)
IDAutomationC128 This code128 function "interleaves" numbers into pairs for high density.
(DataToEncode, 0) formats output to the Code 128 barcode fonts.
(DataToEncode, 1) returns the human readable text with the check digit included.
(DataToEncode, 2) returns only the check digit.
Code39
(DataToEncode)
IDAutomationC39
or
IDAutomationHC39
Formats the output to print using Code 39 fonts.
Code39Mod43
(DataToEncode)
(ReturnType)
IDAutomationC39
or
IDAutomationHC39
(DataToEncode, 0) performs the mod43 checksum calculation for increased accuracy and then formats the output to print using Code 39 fonts. The mod43 checksum is usually required for LOGMARS and HIBC applications.
(DataToEncode, 1) returns the human readable data with the check digit included.
(DataToEncode, 2) returns only the check digit.
Code93
(DataToEncode)
IDAutomationC93 Formats the output to print with the 2 required check digits using Code 93 fonts.
Codabar
(DataToEncode)
IDAutomationCB Formats the output to print using Codabar fonts.
Code11
(DataToEncode)
IDAutomationC11 Formats output to the Code 11 fonts. Only the "C" check digit is calculated which is the standard when encoding 10 digits or less.
EAN13
(DataToEncode)
IDAutomationUPCEAN DataToEncode is a number string of 12, 13, 14, 15, 17 or 18 digits with or without a check digit, add-ons are supported. Formats output to the UPC/EAN barcode font. Entering incorrect data will create a barcode containing all zeros.
EAN8
(DataToEncode)
IDAutomationUPCEAN DataToEncode is a number string of 7 or 8 characters (EAN-8 without the check digit). Formats output to the UPC/EAN barcode font. Entering incorrect data will create a barcode containing all zeros.
I2of5
(DataToEncode)
IDAutomationI25
or
IDAutomationHI25
This function "interleaves" numbers into pairs for high density without check digits and formats the return string to the Interleaved 2 of 5 fonts.
I2of5Mod10
(DataToEncode)
(ReturnType)
IDAutomationI25
or
IDAutomationHI25
(DataToEncode, 0) performs the mod10 checksum calculation for increased accuracy and formats the return string to the Interleaved 2 of 5 fonts. MOD 10 checksums are required by USPS for special services and for SSC-14 when using Interleaved 2 of 5 for that purpose.
(DataToEncode, 1) returns the human readable data with the MOD10 check digit included.
(DataToEncode, 2) returns the MOD10 check digit.
MOD10
(DataToEncode)
Not Applicable Returns the MOD 10 check digit for a given string of numbers according to the UCC/EAN method.
MSI
(DataToEncode)
(ReturnType)
IDAutomationMSI
or
IDAutomationHMSI
(DataToEncode, 0) formats output to the MSI barcode fonts.
(DataToEncode, 1) returns the human readable data with the check digit included.
(DataToEncode, 2) returns only the check digit.
Postnet
(DataToEncode)
(ReturnType)
IDAutomationPOSTNET
or
IDAutomationPLANET
Enter a single string of Zip, Zip + 4 or Zip + 4 + Delivery Point or any number of digits for the planet code. The DataToEncode must be a number and can include dashes and spaces.
(DataToEncode, 0) formats output to the Postnet barcode fonts.
(DataToEncode, 1) returns the human readable data with the check digit included.
(DataToEncode, 2) returns only the check digit.
RM4SCC
(DataToEncode)
IDAutomationRM Formats the output to print using RM4SCC fonts. Checksum calculated according to the mail sort customer bar-coding specification.
SpliceText
(DataToEncode) (SpacingNumber) (ApplyTilde)
Text Font Returns text with a space inserted every SpacingNumber of digits to improve readability. If ApplyTilde is set to True, the tilde will be processed as described here.
UCC128
(DataToEncode)
IDAutomationC128 This barcode function calls the Code128() method with the Tilde option enabled and the FNC1 character in set C as required. It is often an easier method to use when encoding an even number of number-digits. For example, to encode an SSCC-18 barcode, enter 00000123455555555558 as the data input. Formats output to the Code 128 barcode fonts.

More information about AIs and UCC/EAN-128 is located here.

UPCa
(DataToEncode)
IDAutomationUPCEAN DataToEncode is a UPC-A number string of 11, 12, 13, 14, 16 or 17 digits with or without a check digit, add-ons are supported. Formats output to the UPC/EAN barcode fonts. Entering incorrect data will create a barcode containing all zeros.
UPCe
(DataToEncode)
IDAutomationUPCEAN DataToEncode is a UPC-E number of 6, 7 or 8 digits or a UPC-A number string of 11, 12, 13, 14, 16 or 17 digits with or without a check digit, add-ons are supported only with 13, 14, 16 or 17 digits. Formats output to the UPC/EAN barcode fonts. Entering incorrect data will create a barcode containing "00005000000". UPC-E1 is supported when the first character is "1" instead of "0".
These Functions have been replaced with the Code128() function:
USPS_EAN128 () IDAutomationC128 The USPS_EAN128 function has been replaced by the Code128() function.
 
Used for USPS special services labels such as delivery confirmation in EAN128 according to the USPS Delivery Confirmation Service defined in the September 2002 version of Publication 91. This is used with IDAutomation's Code 128 font IDAutomationC128L at 16 points. The following formula will create USPS_EAN128 in Code 128 with the Code128() function:
Code128 ("" & "912312214123442441134" 
& "~m19", 0, True )
Where the number of 912312214123442441134 may be replaced with the data field, for example:
Code128 ("" & {Table1.DataField1} 
& "~m19", 0, True )
This encoded number consists of a 2 digit service code + 9 digit customer ID + 8 digit sequential package ID + MOD 10 check digit.

For more information, refer to the USPS portion of the Code 128 FAQ and the UCC/EAN portion of the Code 128 Barcode FAQ.
SCC14() IDAutomationC128 The SCC14 function has been replaced by the Code128() function.

The following formula will create SCC14 in Code 128 with the Code128() function:
Code128 ("" & "013001234567890" 
& "~m13", 0, True )
For more information, refer to the UCC/EAN portion of IDAutomation's  Code 128 Barcode FAQ.
SSCC18() IDAutomationC128 The SCC18 function has been replaced by the Code128() function.

The following formula will create SCC18 in Code 128 with the Code128() function:
Code128 ("" & "0000801234999999999" 
& "~m17", 0, True )
For more information, refer to the UCC/EAN portion of IDAutomation's Code 128 Barcode FAQ.

* NOTE: Interleaved 2 of 5 fonts dated May 1, 2001 or later must be used for Interleaved 2 of 5 functions, and Code 128 fonts dated December 2000 or later must be used for Code 128 functions.

Function Property Descriptions

  • DataToEncode: a string value that represents the data being encoded.
  • ApplyTilde: when ApplyTilde is set to "1" in Code 128 with the Auto character set, the format ~ddd may be used to specify the ASCII code of the character to be encoded and several other tilde options are enabled.
Importing Barcode Methods into a Shared Script Library

Barcode functions may be imported into the shared script library. For example, in Domino Designer 7 perform the following:

  1. Choose Shared Code - Script Libraries.
  2. Select New LotusScript Library.
  3. After the Option Public statement, right click and choose Import.
  4. Select the IDAutomationLS.lss file, which is provided in the LotusScript download package.
 © Copyright 2014 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
Training Videos on YouTube Join us on Google Plus Join us on LinkedIn Follow us on Twitter Like us on Facebook
Over 70% of Fortune 100 companies use IDAutomation's products to automate their businesses.