Generate QR in Salesforce

Generate QR Code for any Salesforce Object in 5 Min

What is a QR Code? So you may have heard that QR Codes are set to become the ‘next big thing’ but thinking to yourself, what is a QR Code!? QR or Quick Response Codes are a type of two-dimensional barcode that can be read using smartphones and dedicated QR reading devices, that link directly to text, emails, websites, phone numbers and more! You may have even got to this site by scanning a QR code!

Implement in Salesforce: You need to follow just simple steps to create QR code for an object in salesforce. So pick any object for this. I have picked Contact object.

  1. Click on Setup. It is placed on Top-Right.
  2. Then in Left panel, go to Customize –> Contacts –> Fields
  3. Click on New button to create the new custom field.
  4. Select Formula field type here.
  5. Fill field name with “QR Code” and Select Formula Return Type as “Text”
  6. Then paste the following code in formula area: IMAGE(‘https://chart.googleapis.com/chart?chs=200×200&cht=qr&chl=https://cs87.salesforce.com/’&Id ,’Scan QR code to open record in mobile.’)

Note: Please change single quote (marked as red) in above formula otherwise it will give error.

You can copy above code from here. If it doesn’t work.

Explanation of above code:

  1. IMAGE(image_url, alternate_text [, height, width]) : Is a function to show image with giving URL.
  2. https://chart.googleapis.com/chart chs=200×200&cht=qr&chl=https://cs87.salesforce.com/’& Id
    • 2.1 https://chart.googleapis.com/chart : Is Google Chart API
    • 2.2 chs: Height and width of QR Code
    • 2.3 cht: Chart Type. We need to put qr for QR code
    • 2.4 chl: QR Code will generate this text. (In our example I am putting URL of record)

Note: Please put your domain Url instead of https://cs87.salesforce.com

Now Save your formula field and open any record. You can see a QR Code on record.

Screen Shot 2016-06-04 at 8.51.10 AM

Now you can use any QR Code scanner app on mobile. I am using Google Goggles. You can download from here: https://play.google.com/store/apps/details?id=com.google.android.apps.unveil&hl=en

Now Open this app and scan your code. It will look like this:

Screenshot_2016-06-04-08-54-09

Click on generated link on the bottom of the screen. It will redirect to record.

Screenshot_2016-06-04-08-54-49

Happy Salesforce!!!


Blog Originally Posted Here.

0 Comments

Leave a Reply

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2020 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?