+ Start a Discussion
dev rana 10dev rana 10 

Want to Generate QR Code

Hello Ever one i want generate QR Code through apex And VF So can You plz give some code.


Thanks in Advance
Ispita Saha 20Ispita Saha 20
For QR code generator you may or refer to the following link:-
http://stackoverflow.com/questions/4542632/qr-code-generation-library-in-javascript
Let me know if it is what you are looking for.
VineetKumarVineetKumar
Explained Step by Step
http://www.tgerm.com/2012/11/salesforce-qr-code-visualforce-contact.html

with some minor manipulations you can use this on your VF page.
Amit Chaudhary 8Amit Chaudhary 8
Please check below post. I hope that will help you
Generate QR Code for any object in 5 Min:
1) https://vishnuvaishnav.wordpress.com/2016/06/04/generate-qr-code-for-any-object-in-5-min/

Let us know if this will help you
 
Martin Hurst 9Martin Hurst 9

Generate QR Code for any Salesforce Object no coding

 
Implement QRC code generation in Salesforce for Case record:

Here is a method to generate a QRC code that links to a specific Case record.
From doing this, you can then generate an HTML email template that has this QRC code embedded in the email.
The recipient of this email can open the email and either print it off to be scanned or have it scanned from their mobile device, for example, when they attend an event put on by your company.
 
This method utilizes, i.e., uses the API free services of QR-Server QR Code API | ProgrammableWeb, https://www.programmableweb.com/api/qr-server-qr-code
 
  1. Click on Setup. It is placed on Top-Right.
  2. Then in Left panel, go to Customize –> Cases –> 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("http://api.qrserver.com/v1/create-qr-code/?size=75x75&data=" + "https://na59.salesforce.com/" + Id ,"scan this")
 
add qrc field to case record

qrc code displayed in case record

 
  1. Scan and capture the QRC code with your mobile app.
  2. Click/touch the link on the mobile app screen to open it.
qrc code scanned by mobile device 
 
  1. Since this is a Salesforce link to the Case record, it will prompt to open the Salesforce1 app.
  2. Log in using your Salesforce credentials.
  3. The Case record that was embedded in the QRC code will now open in the Salesforce1 mobile app.
  4. You can now view and update this Case record accordingly.
 case record opened from qrc code scan
 
 
 
 
Martin Hurst 9Martin Hurst 9
This is a follow up to my previous post "Implement QRC code generation in Salesforce for Case record".

Create the Custom Email Template (without using Letterhead)
 
  1. Setup > email templates > Classic Email Templates > New Template > select “Custom (without using Letterhead)”
  2. Click Next
  3. Type the Email Template Name
  4. Type in a Description
  5. Leave the subject blank for now
  6. Click Next
  7. Type the Subject line and make sure you include “{!Case.Thread_Id}” value.
 
  1. Below is a sample of the body content that will contain basic HTML content:
 
-------------------------------------------------
 
1. Inserts the company or client logo at the top of the email
<img src="https://c.na<nn>.content.force.com/servlet/servlet.ImageServer?id=015f4000001y2ee&oid=00Df4000003kPfb&lastMod=1528118628000" alt="Logo"/><br><br>
 
2. Some sample content in the body of the email template
Thank you for inquirying about eligibility for home ownership program request online form.<br><br>
Based on your answers you provided, we may invite you to attend our Informational Session.<br><br>
 
3. This line includes a Casecustom field
The Information Session will be held, {!Case.Campaign_Start_Date_reformatted__c}.<br><br>
 
4. This line incldues the Casenumber field
Your new Case reference # is, {!Case.CaseNumber}<br><br>
 
5. This line generates and displays the QRC code of the Case URL link
<img src="http://api.qrserver.com/v1/create-qr-code/?size=75x75&data=https://na59.salesforce.com/{!Case.Id}" alt="Logo"/><br><br>
 
6. make sure you include “{!Case.Thread_Id}” value in the body of the email template
Thank you for choosing our company.<br><br>
Kind Regards,<br><br>
{!Case.Thread_Id}
 
 
Here is the whole email template html text:
------------------------------------------------
<img src="https://c.na59.content.force.com/servlet/servlet.ImageServer?id=015f4000001y2ee&oid=00Df4000003kPfb&lastMod=1528118628000" alt="Logo"/><br><br>
Thank you for inquirying about eligibility for home ownership program request online form.<br><br>
Based on your answers you provided, we may invite you to attend our Informational Session.<br><br>
The Information Session will be held, {!Case.Campaign_Start_Date_reformatted__c}.<br><br>
Your new Case reference # is, {!Case.CaseNumber}<br><br>
<img src="http://api.qrserver.com/v1/create-qr-code/?size=75x75&data=https://na59.salesforce.com/{!Case.Id}" alt="Logo"/><br><br>
Thank you for choosing our company.<br><br>
Kind Regards,<br><br>
{!Case.Thread_Id}
 
------------------------------------------------
 
 
HTML Email Template sample with embedded generated QRC code.

qrc html email template sample