Here we cover an easy way to display barcode in lightning experience using a free appexchange app Barcode and QR Code Generator.
This app allows you to generate barcode in Salesforce without depending on any external services. In below example, we are assuming that you have the app installed already. If not please go to Barcode and QR Code Generator and install.
Example - Displaying barcode using email field in lead
Here we will go through an example of displaying barcode using data from email field in lead records. This is just one example. Same approach will work for any other field in any custom/standard object in Salesforce.
1) Create a barcode config record for lead email field
Go to "Barcode Configs" tab that comes with the app and create a new record. Give it a name without spaces or special characters.
Specify lead
as object name and email
as field name.
You can leave other fields with default values. Then save the record.
Please check below screenshot,
Once you have created a barcode config record, it is just matter of editing lead flexipage and adding "Barcode and QR Code Generator" component to the page.
First go to a lead record details page
. Click Gear Icon and "Edit Page".
Drop "Barcode and QR Code Generator" component from left sidebar to the place you need. It will ask for a configName. Give the name of the record you created from step 1.
Click "Save" button on top right and finally click "Activation" on top right and assign the page as organization default (or based on your app or profile preferences).
Result
If you followed the steps correctly, you should see barcode when you go to any lead record page.
Use cases
Barcode generation and scanning can be used to improve a lot of business processes. Some examples are,
- Generate product barcodes and stick labels to products so that you can scan and add products to opportunity
- Generate QR code corresponding to your event registration custom object field(Id or registration number) and email users, so that you can scan in participants at the time of the event
- Stick a QR code in your outgoing shipments and incoming shipments and then scan it into Salesforce records so that you can track shippings end to end
- Need to scan the barcode values to Salesforce as well? Check out the article here
Hi, I have installed this. Looks got so far. Now I come up with another question.
ReplyDeleteMy Use Case it to about attendee management. I store all registrations within a custom object related to a Lead. Now I would like to store and send out the QR Code by Email from the custom registration record using process builder or list emails. What´s yours suggestion to make this happen
Glad to hear. Thank you for the feedback.
DeleteI would recommend enabling Salesforce site and exposing a custom page that exposes barcode component. Then include that URL with some parameters in your registration emails. Please drop an email to albertsfo1@gmail.com if you would like to get on a call and discuss in detail.
Hello Is there a way to add the Field Name/Custom Label over the Generated Code? Our Use Case is that we are generating 2 Codes per record - referring to 2 fields. And we need to distinguish that which Code refers to which field.
ReplyDeleteBy default the data used to generate the barcode should be displayed below the barcode itself. Does that work in your use case?
DeleteIs this QR code compatible with the mobile app?
ReplyDeleteYeah. It will work in mobile app. You can either surface it as a quick action or in a flexi page.
DeleteI have installed the package and it looks good thus far. I have a specific use case that the generated QR code needs to be printed on a membership card from within Salesforce. Previously we solved this using an external service to generate the code and displaying it in a formula field for printing purposes. I would really like to move away from external service for the generation. Any input on how your tool may facilitate this?
ReplyDeleteI installed the app in my dev box. I am getting an error saying "refused to connect" is there something I missed in the set up process?
ReplyDeleteI have the same issue...
DeleteI just tested in chrome and firefox. It is working fine. Which browser are you using?. Looks like a browser security setting blocking iFrames. Can you please try adding a CSP setting for the app's namespace under Setup => CSP Trusted Site. "https://yourMyDomainNameHere-dev-ed--barqr.visualforce.com" is the URL to whitelist
DeleteTried whitelisting it and still says --barqr.visualforce.com refused to connect.
DeleteI'm also getting that error, added the url to the whitelist. Any thoughts?
DeleteIt's do to clickjack protection, set in session settings. can add visualforce trusted domains, under trusted domains. That resolved it in my case.
DeleteHello,
ReplyDeleteIs there a way I can include this generated barcode in a vf page
Thanks,
Sujith
You can use it in a VF page. There is a VF page that is included as part of the package. You just need to pass recordId and barcode config record names as parameters to the page.
DeleteWhat if I want to include barcode in already existing VF Page?
DeleteI can see that there is a VisualForce component BarcodeVFComponent. Would it be possible to make the component global so it can be resued?
Hi, this is great. Is there a way to access to generated bar code via a URL, so I can use it somewhere else, e.g. in a document?
ReplyDeleteYou can create a lightning page that uses the component. Then dynamically pass the recordId as parameter to the page
DeleteHi, is very useful app. But can i create a QR by more than one field? and can i do it ?
ReplyDeleteThanks
How i can do it?
DeleteYou just need to create different barcode config records corresponding to the fields. Then drop the lightning components multiple times to the page each time specifying a separate config name.
DeleteVery useful app. Easy configuration. Thank you for the article
ReplyDeleteThank you.
DeleteHi I am having issues with the url that I am using to redirect the User using the QR Code. It does not seem to like the & in the url any advice
ReplyDeleteThis issue is fixed now. Basically earlier & character was getting escaped as &. In new version of the app, it should render correctly.
DeleteI have added this barcode on account object to generate barcode from external id field. I need to send this barcode for every account record to external system via api call in json. how do i acheive this
ReplyDeleteThat would require some custom development on top of the app. Would you like to drop an email to albertsfo1@gmail.com with details?
DeleteHello! I have setup a QR code to display on assets. It appears correctly on the page but when I try to scan it, it does not open Salesforce. What I am missing ?
ReplyDeleteThis app is only for generating barcode. If you want to scan the record and do some custom actions, you might need a mobile app like this one - https://salesforcecodes.blogspot.com/2021/06/how-to-scan-barcode-values-and-send-to-salesforce.html
DeleteI just want to be redirected to salesforce record when I scan th e code using my Iphone. Any mobile app should allow that, isn't it ?
Delete@admin I've just checked, and I have the same redirection problem in the Sandbox where I tested the QR code : scanning the code do not redirect to Salesforce anymore. Instead it opens Google to search for the Salesforce record name.
DeleteI think that is more specific to the app you are using to scan. Is your QR code, corresponding to the URLs of the asset?
DeleteHi, Can I add more objects and fields to generate a QR code in the Barcode Config?
ReplyDeleteYou can create as many barcode config records as needed. Please use different names. Then drop the component to the page multiple times and specify the name of the config you want to display there.
DeleteWould it be possible to export the qr code image in a report? I'm trying to export this information with names so we can build badges for our volunteers. Any advise on how?
ReplyDeleteHi,this is an amazing app!
ReplyDeleteI have a question that is it possible to add vf component into vf page created by myself. I have tried to use BarQR:BarcodeVFComponent into my vf page but the barcode doesn't display. By the way, I want use the barcode in vf page as pdf at last.
wait for reply.
best regards
Lee
And I have configed the parameters in the url and make sure them work well by use them in the vf page that you provide
DeleteYou configed which parameters in the url please ?
DeleteI'm facing the same issue tryint to use the component on a VFpage
Deletebut no luck
This comment has been removed by the author.
ReplyDeleteReally love this. Just a few questions:
ReplyDeleteAny chance to centre the barcode, via Barcode Configuration?
Any chance to show text with some basic font options, and a little padding?
These are just small visual things, but the thing works so great, I would love to keep using it.
Glad to hear. I can add these enhancements to our backlog.
DeleteHello admin, whatever happened with the enhancements for font options and centering?
DeleteTo Whom It May Concern, We are an nCino shop using their nCino Form Generation. Is there a method by which to embed the dynamic bar code into a form, so that upon generation the bar code is automatically rendered?
ReplyDeleteI am not very familiar with nCino form generation tool. Please drop an email to albertsfo1@gmail.com. We can setup some time to debug this.
DeleteHey - I cannot get the barcode to generate in the page layout :(
ReplyDeleteAre you seeing some error? Can you please share more details?
DeleteHello, I have configured the barcode as described, but when I add it to Accounts layout I get this error on that block "barqr.visualforce.com refused to connect".
ReplyDeleteAm I missing anything???
This is because session settings in your Salesforce environment. Go to Setup -> Session Settings -> uncheck "Enable clickjack protection for customer Visualforce pages with headers disabled"
DeleteHello - very nice app. Thanks for your work. Wondering if the generated barcode may be placed on an Experience Site page? I tried just now to insert and it seems that it does not recognize the parameters as input in the Platform.
ReplyDeleteHello! Do you have any documentation on how we can embed the generated QR Code to the emails we send out? Or maybe if you have a full documentation of all the capabilities of the package we can read through, that would be great.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteeverything was going good. worked on the detail page. but putting on a Salesforce site (community site) the componat is there awesome. but the barcode not showing up
ReplyDeleteHi Admin,
ReplyDeleteI created a configuration on Case object for CaseNumber field and Bar Code Type = Code 128. But when scanning it using BarCodeToCloud app in mobile its giving an error:
Salesforce Operation
Operation: update
Object: Case
Status: error
Message: ["message": InCreatedDate, Id FROM
Case WHERE = '09655795' LIMIT 1\n ^\nERROR
at Row:1:Column:91\nunexpected token:
'='"'"'errorCode":"MALFORMED_QUERY"}]
id:
Fields that I have selected for display/edit are:
Account_name_Formula__c
Assetld
BusinessHoursid
CreatedDate
I followed the video to all the setup but still not working. Can you please help here.
Hello! We installed this package into a salesforce org and it was working great. However, now the QR code is not working only for androids, works fine for iphones. How can this be troubleshooted or resolved?
ReplyDeleteThank you for this comprehensive blog post! It's a great resource for those of us considering AWS certifications. The detailed breakdown of the different certifications is especially helpful. Please visit our website:- amazon aws certification
ReplyDeleteHello,
ReplyDeleteThe app is working fine with QR code generation,
however I'm trying to find out how could we include the generated image in an email template?
Could anybody help please?
I was also not able to do this same thing. I have gone with a different solution.
Deleteusing Data Type Formula
IMAGE('https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl='+Id,'QRCode')
url redirect generator
ReplyDelete