Brian Dunning's FileMaker Custom Functions

cfCode128 ( pString ; pCodeSet )

composes the final barcode Code128 of symbology A,B or C from a given alphanumeric string.

  Average rating: 4.2 (51 votes) Log in to vote

Tammo Fornalik / Felix Hausberner   Tammo Fornalik / Felix Hausberner
dbyte solutions

Share on Facebook Share on Twitter

  Sample input:
cfCode128 ( "SBM16672_2008_08_25"; "B" )
  Sample output:
"SBM16672_2008_08_25" as Code128B including checksum and start/stop tags (viewable with IDAutomation Code128 fonts)

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

composes the final barcode Code128 of symbology A,B or C from a given alphanumeric string.
includes the checksum of the string (modulo 103) as well as start/stop characters.
this CF is meant to be used with barcode font "IDAutomationC128..."

automatic switching between variants A, B, C within a single barcode is not yet supported.

pString: string to be used as a barcode.
pCodeSet: "A" or "B" or "C" are expected.



Kevin OShea   Kevin OShea, San Jose
Apr 26, 2011
Running OS X & FM Pro 11, this function works except that spaces are not encoded properly. They turn into an invalid character (represented as  with all the barcode fonts I've tried).

As a quick solution (I was in a hurry) I just added a substitute line to substitute spaces for the  characters and it seems to work fine.
Eugene Gashinov   Eugene Gashinov, RnD
Jun 15, 2012
I'm stuck on Code 128 B code over 10 chars. All my scanners won't read code without border. Can anyone help with mod to this function to make Code 128 B border in generated code?
Eugene Gashinov   Eugene Gashinov, RnD
Jun 30, 2012
Sry, function work fine!
Didier   Didier, Lyon - France
Dec 12, 2013
Great, smart, thanks !
Tammo   Tammo, Outlaw
Dec 12, 2013
Hey Didier,

thanks for your comment! Meanwhile, I'm on 4D (great, smart, faster, obsolete, grey-haired old fashioned ones have fun with it, just as me) but it's always nice to read some FRESH comments!

Jan 16, 2014
If anyone is concerned with the licensing of the ID Automation fonts I can confirm that this encoding works just fine with the font available here:

Many thanks for this CF, I wasn't looking forward to hacking one together myself.
Harald Klette   Harald Klette, Geraldton Western Australia
Jun 28, 2014
Hi, I am using the IDAutomation Code128 plugin in our filemaker database (FM11 pro) Windows 8 SP1 {4digit code} and it seemed to work all fine over the last year or two. I am doing stocktake today and the following 4 digit numbers print as a "?"


All other 4 digit numbers (from 0001 - 9999) print fine. I havent changed anything (same font same layout same character size) Label machine is DYMO labelwriter 450, but this id not the culprit as it shows already up as a "?" in Filmaker.

Any idea, pointing in a directionor other help is much apprechiated.
I am really confused about it.

Rafael Santana   Rafael Santana, Caracas, Venezuela
Sep 15, 2014
Getting mixed results using the free Code 128 True Type font.
This great function get it almost always right (as in 1977.2), failing in some 1% of times (as in 1977.3 or in 2002.37), stamping a big "Â" just before the stop bars.

Any ideas?

Rico Meier   Rico Meier, MeiSol AG
Feb 1, 2016
i have the same problem. with pcodeset "A" the number 20538 result in "Â"..


Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 16 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: