For the complete documentation index, see llms.txt. This page is also available as Markdown.

AX - Barcode

Overview

AX - Barcode is a Lightning App Builder component that generates scannable codes—including QR codes, standard barcodes, and other formats—directly on your record pages, app pages, and home pages.

Use it to display codes based on Salesforce field values like record IDs, product numbers, URLs, or tracking information. Users can scan these codes with mobile devices to quickly access records or information.

Getting Started

Use this simple tutorial to learn the basics of the Barcode component and start building your use cases.

spinner

Use Cases

Inventory & Asset Management

  • Generate asset tags with QR codes linking to equipment records

  • Create inventory labels with product codes and tracking information

  • Display serial numbers as scannable codes for quick lookup

Event & Access Management

  • Generate event tickets with QR codes for attendee check-in

  • Create access badges with unique identifiers for security

  • Display conference session codes for quick registration


Configuration

Properties

Label
Type
Default
Required
Description

Value

String

Yes

The data or text string to encode and display as a barcode or QR code. Example: https://company.com/product/12345 or Asset-001.

Type

String

Defines the barcode format to render. Supports a wide range of barcode standards including QR codes, Code128, DataMatrix, EAN, UPC, PDF417, and many others. Options: auspost, azteccode, azteccodecompact, aztecrune, bc412, channelcode, codablockf, code11, … (105 total).

Width

String

The width of the barcode in pixels or valid CSS units (e.g., 200px, 100%).

Height

String

150

The height of the barcode in pixels or valid CSS units (e.g., 200px, 150px).

Hide Value

Boolean

false

If true, hides the human-readable value displayed below the barcode.

Background Color

String

The background color of the barcode area. Accepts valid CSS color values such as hex codes (#FFFFFF), RGB, or named colors.

Color

String

The color of the barcode's bars or QR modules. Accepts valid CSS color values.

Text Color

String

The color of the human-readable value text, if displayed. Accepts valid CSS color values.

Text Alignment

String

bottom-center

Controls how the human-readable value (the text shown with the barcode/QR) is aligned. Valid values: left, center, right. Applies to the text label—not the bars/modules themselves. Options: top-right, top-left, top-center, top-justify, center-right, center-left, center-center, center-justify, … (12 total).

Header - Title

String

Text shown as the main heading above the audio player. Ideal for contextual labeling, such as “Top Opportunities” or “Recent Cases.”

Header - Caption

String

Subheading text shown below the main title. Used to provide additional context such as “Sorted by Close Date” or “Filtered by Priority.”

Header - Icon Name

String

Salesforce Lightning Design System icon name (e.g., standard:product, standard:products) that appears next to the title. Used for visual context or branding.

Display as Card

Boolean

false

If true, displays the barcode within a styled card container, suitable for dashboards or embedded record page use.

Use Case Examples

Example 1: Asset Tracking QR Code

spinner

Scenario: Generate QR codes for equipment assets that link to their detail records with professional styling.

Prerequisites: This example uses the standard Asset object in Salesforce. For this demonstration, we've created a custom field Asset_QR_URL__c (Text field) that contains the asset's URL. In your implementation, you would create your own custom field with an appropriate name for your use case. Ensure your Asset records have populated Name and SerialNumber fields for proper display.

Steps

1

Drag the AX - Barcode component onto your page layout (from the Custom Components panel)

2

Configure the AX - Barcode component

  • Set Value to {{Record.Asset_QR_URL__c}} (this references our demo custom field - replace with your own field name)

  • Set Type to qrcode (QR Code format)

  • Leave Hide Value unchecked (show URL for reference)

3

Configure visual styling

  • Set Width to 200px

  • Set Height to 200px

  • Set Background Color to white

  • Set Color to black

  • Set Text Color to #666666

  • Set Text Alignment to center

4

Configure the header

  • Set Header Title to Asset QR Code

  • Set Header Caption to {{Record.Name}} - {{Record.SerialNumber}}

  • Set Header Icon Name to standard:asset_object

5

Display as Card for a professional presentation

6

Save and test QR code scanning

  • Save and activate the page.

Result: Professional asset QR codes that link directly to asset records when scanned, complete with asset information in the header.

Example 2: Event Check-in Code

spinner

Scenario: Create compact event tickets with attendee-specific codes for mobile scanning at registration.

Prerequisites: This example assumes you have created a custom Event Attendee object (Event_Attendee__c) with custom fields including Event__c (lookup to Event), Attendee_Name__c (text field for attendee names), and appropriate Lightning record pages

Steps

1

Open Lightning App Builder and edit your Event Attendee record page

2

Add the Barcode component to your ticket section

3

Configure the check-in code

  • Set Value to EVENT-{{Record.Event__c}}-ATT-{{Record.Id}}

  • Set Type to code128 (traditional barcode format)

  • Check Hide Value for clean ticket appearance

4

Configure compact sizing

  • Set Width to 300px

  • Set Height to 80px

  • Set Background Color to #f8f9fa

  • Set Color to #000000

5

Configure event header

  • Set Header Title to Check-in Code

  • Set Header Caption to {{Record.Attendee_Name__c}}

  • Set Header Icon Name to standard:event

6

Check Display as Card for ticket-style presentation

7

Save and verify barcode readability

Result: Clean, scannable event check-in codes with attendee information, perfect for mobile registration workflows.


Key Considerations

  • Content Strategy: Use meaningful, scannable values that include record IDs or unique identifiers for tracking; mind URL length and complexity in QR codes.

  • Visual Design: Choose a barcode type suited to your scanning devices, with strong color/background contrast and sizing appropriate to the viewing distance.

  • User Experience: Add header titles and captions for context, and include human-readable text when users need to reference the value manually.

  • Performance: Avoid excessively long values that create complex barcodes; test generation with dynamic values and verify readability across screen sizes.


Troubleshooting Common Issues

  • Barcode Not Generating: Verify the Value field has valid, non-empty data and that {{Record.FieldName}} references point to existing fields users can view.

  • Scanning Issues: Increase size for mobile or distance scanning, ensure sufficient Color/Background contrast, and try a different barcode type if reads are unreliable.

  • Display Problems: Check Width/Height use valid CSS units and colors use valid formats; test responsive behavior across screen sizes.

  • Dynamic Content Issues: Confirm referenced fields contain data, API names are spelled correctly, and users have read permission on those fields.

  • Styling Inconsistencies: Use Display as Card for consistent treatment and verify color choices work with your Lightning page theme.

Last updated

Was this helpful?