wptucson Posted February 14, 2014 Posted February 14, 2014 I'm trying to create a 128 barcode with the following information and am not getting the correct output. I'm sure there is something incorrect in my code but I can't figure out what it is... Can someone please point me in the right direction? The field "XPN" dictates the information to be used for the barcode. Here is the code: if (Field("XPN") == "70-0024-012") return Make128Barcode("M00582040", true); else if (Field("XPN") == "70-0024-014") return Make128Barcode("M00582050", true); else if (Field("XPN") == "70-0024-016") return Make128Barcode("M00582060", true); else if (Field("XPN") == "70-0024-018") return Make128Barcode("M00582070", true); else if (Field("XPN") == "70-0024-020") return Make128Barcode("M00582080", true); else if (Field("XPN") == "70-0024-022") return Make128Barcode("M00582860", true); else if (Field("XPN") == "70-0024-024") return Make128Barcode("M00582090", true); else if (Field("XPN") == "70-0024-028") return Make128Barcode("M00582100", true); else return " "; Quote
blackbelt60 Posted February 17, 2014 Posted February 17, 2014 Hello. I would do this: var Var6 = "IDAutomationC128L"; final_data = ""; if (Field("nbr") == "70-0024-012") return final_data = '<span><f name="' + Var6 + '">' + NormalizeEntities(Make128Barcode("M00582040")) + '</span>'; else if (Field("nbr") == "70-0024-014") return final_data = '<span><f name="' + Var6 + '">' + NormalizeEntities(Make128Barcode("M00582050")) + '</span>'; else if (Field("nbr") == "70-0024-016") return final_data = '<span><f name="' + Var6 + '">' + NormalizeEntities(Make128Barcode("M00582060")) + '</span>'; else if (Field("nbr") == "70-0024-018") return final_data = '<span><f name="' + Var6 + '">' + NormalizeEntities(Make128Barcode("M00582070")) + '</span>'; else if (Field("nbr") == "70-0024-020") return final_data = '<span><f name="' + Var6 + '">' + NormalizeEntities(Make128Barcode("M00582080")) + '</span>'; else if (Field("nbr") == "70-0024-022") return final_data = '<span><f name="' + Var6 + '">' + NormalizeEntities(Make128Barcode("M00582060")) + '</span>'; else if (Field("nbr") == "70-0024-024") return final_data = '<span><f name="' + Var6 + '">' + NormalizeEntities(Make128Barcode("M00582090")) + '</span>'; else if (Field("nbr") == "70-0024-028") return final_data = '<span><f name="' + Var6 + '">' + NormalizeEntities(Make128Barcode("M00582100")) + '</span>'; else return " "; ------------------------ "nbr" is the field name... Also, please remember to tick the "return as tagged text" cell before saving the rule. Ciao Maurizio Quote
wptucson Posted February 17, 2014 Author Posted February 17, 2014 Thanks blackbelt60! It turns out the particular barcode that I'm looking for is specific to the health industry (HIBC) and not the typical 128 barcode. That explains why it wasn't showing the correct output! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.