Skip to main content

Salesforce and QR server integration for QR code generation in Salesforce

QR codes are very helpful in emails or business cards and often we get requirements in mobile application or a mail send to lead from salesforce to contain these QR code .

There has been lot of talks and debates on usability of this technology .Infact google has deprecated the API. Nevertheless some customers still prefer this technology and we often find QR codes in business cards ,front page of books ,Quotes and so on.

So this blog post demonstrates how to form the QR code in salesforce with the help of the qrserver

Please make sure to read the terms and conditions of the qrserver.com before using the QR code API for commercial  purpose .

There is already a good blog post from one of the MVP on this and hence it was very simple task for me to read and follow.Here is the link to the blog and it was nicely written.
http://www.tgerm.com/2012/11/salesforce-qr-code-visualforce-contact.html

The above blog used google chart API but since google have deprecated this API ,i had to look for the other websites providing me the API.

There were couple of good websites .

1)http://qrserver.com/api/documentation/create-qr-code/
2)http://www.sparqcode.com/static/QRGenAPI

In this blog i will be describing how to use formula field to generate the QR code using the qrserver.com API .The procedure remains same as we use with google chart API as demonstrated in the blog.

My assumptions are i have employee custom object and i have a formula field named QRCode and remote site settings has been configured for the http://qrserver.com/ .

so here is the formula using IMAGE function of the salesforce on how to bring the QR code from the qrserver.com

IMAGE('http://api.qrserver.com/v1/create-qr-code/?data='+ Name ,'hello',50,50)

Make sure to specify URL in small caps in image tag.For the readability purpose i have made all caps and in actual those are in small caps


data field consists of the content that will be displayed once the QR code is scanned by the reader.

Please note how the variable Name is used .Actually its  a merge field used from the formula editor and hence for each record this is dynamically populated .

50-Height of the image in pixel

50-Width of the image in pixel.

'hello '-string that will be displayed in case image fails to renders 



The QR image can be easily scanned with QR readers.There are number of readers available for mobile and the desktop.

I downloaded a QR code reader for my desktop from the URL below and works great .


From the screen the reader automatically scans the QR code and decodes the Text in it .

A small hint incase you need this image on the visualforce page here is the code to help

Hope the above information is helpful for people looking for sample approach on QR code generation in salesforce.





                                        

Popular posts from this blog

TLS 1.0 has been disabled For Sandbox - Salesforce

Salesforce has finally disabled TLS 1.0 in sandboxes .This is in preparation for disablement later in 2017 for PRODUCTION instances .

Now this would have not impacted your integrations in PRODUCTION org but if your integration is broken in your sandbox ,this means you have only few months to sort this and fix before this affects your integration for PROD live users .
Before we deep drive on how to possibly fix this and work with your external systems to figure solution ,lets first understand what is TLS and why did SFDC moved to 1.x and had to disable TLS 1.0
TLS 1.0 Explained























TLS 1.1 Improvements 
Added protection against cipher-block chaining (CBC) attacks. Support for IANA registration of parameters.

Clearly TLS 1.1 is more secure(Compared to 1.0) and protects salesforce resources against CBC attacks .
Identify if this change broke anything .The things that can be affected in your instances are as below Web requests to Salesforce URLs that require authenticationWeb requests to the login pag…

Opening Modal Using Lightning Component Framework of SFDC

One of my friend from India threw a challenge .The challenge was to open a modal by using latest and greatest lightning components framework and modals design from SLDS .For the love of community I thought of sharing the entire code base that I did .

So here we start ..

Business Use Case - Need a handy SalesLeader board component that can be used to display the Sales revenue generated by each sales rep for current year in the order of decreasing total revenue .On click of the tile ,we will show detail opportunity list aggregating the revenue .

The component can be dragged in lightning design experience or in App builder lightning Page .

Video Demonstration-



SalesLeaderBoard from Mohith Kumar Shrivastava on Vimeo.








Frameworks Used -
Lightning Design Systems (SLDS) for CSSLightning Component Framework for client side logicApex aura enabled class for backend logicApproach
The component hierarchy is very important to imagine or mindmap before we dig deeper- SalesLeaderMain
    -SalesLeaderBoard
    …

Customizing Napili Template Of SFDC For Communities - Community Cloud

Recently I have been busy working with salesforce community cloud platform and I am impressed by the new added features of Spring 16 .

You can watch the Release Readiness webinar for more details on what are added features for community cloud 

Lets talk about something which most of client (Either SI or ISV ) would love to have with the Napili template .The first question that clients ask with Napili is its flexibility to customize and tailor to their specific needs .

The very straight forward questions that people familiar with Napili template ask are as follows 

Can I change the CSS and look and feel ?  

Well yes and No ....The new branding editor you can sparingly use CSS and change look and   feel   and community editor can also help you to some extent to change labels and the color and you can really get closer to what you want .Just note that efforts will be high if we want to change the entire template design.

Will i be able to populate data from custom objects and standard objects a…