Jump to content

QR code Returning Graphic when Field is Empty

Recommended Posts

I am generating QR codes for the front and back pieces of artwork using the Graphic Rule QR Barcode. I created the rule and added the box to the artwork pages. It is appearing on a record where the field that is generating the QR code is blank in the data. Why is the QR code still generating when there is no data in the field? The code from the Rule is below.


// Rule converted from XML Template "QR Barcode: qrShortUrl":
// Choose the following values:
// Begin XML Template selections //
var RuleOrFieldToEncode = "qrShortUrl"; // "Data field or rule to encode" (Required): FieldOrRuleList
var EncodingMode = "Byte"; // "Encoding mode" (Required): PickList ["Byte" (All characters), "AlphaNumeric" (Alphanumeric only), "Numeric" (Numeric only)]
var ErrorCorrectionMode = "Q"; // "Error correction" (Required): PickList ["L" (Low), "M" (Medium), "Q" (Quality), "H" (High)]
var PreferredFormat = "0"; // "Format (symbol size)" (Required): PickList ["0" (0 (automatic)), "1" (1 (21x21)), "2" (2 (25x25)), "3" (3 (29x29)), "4" (4 (33x33)), "10" (10 (57x57)), "40" (40 (177x177))]
var ProcessTilde = false; // "Process tilde (~) escapes": CheckBox
var foreColor = "Black"; // "Barcode color (optional; defaults to Black):": ColorList
// End XML Template selections //

var DataToEncode = RuleOrField(RuleOrFieldToEncode);
return MakeQRBarcodeGraphic(DataToEncode, ProcessTilde,
                           EncodingMode, ErrorCorrectionMode, PreferredFormat, foreColor);

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...