QR vCard for Contacts

Although Salesforce will release a functionality in the Summer ’25 release (https://ideas.salesforce.com/s/winners) that allows for generating alerts with the option to discard records, in the meantime, I am providing an LWC that at least notifies users about the status of records. This Alert Component is a practical and versatile Lightning Web Component designed to enhance user notifications within your Salesforce environment. It supports different display methods (popup, banner) and alert types (warning, error, info), making it suitable for a wide range of use cases.

HACKS

jmelon

6/15/20242 min read

To use this hack, create a new formula field in the Contact object with the return type set to Text, like the one shown in the Formula Explanation section. Add this field to the Contact Page Layout/Lightning page to display the QR code. When users scan this QR code, the contact information will be saved to their mobile devices. Note that this version of the formula does not include substitutions for special characters, meaning that any special characters present in the data fields are not encoded. This can cause issues if the fields contain characters that need to be URL-encoded.

Configuration

1. IMAGE Function:

  • IMAGE(url, altText): This function displays an image from the specified URL. The URL is generated dynamically to include vCard data.

  • "QR Code" is the alternative text for the image.

2. QR Code Generation URL:

3. vCard Data:

  • vCard Start and Version:

    "BEGIN:VCARD%0AVERSION:3.0%0A": Marks the beginning of the vCard and specifies the version as 3.0. %0A represents a newline character.

  • Name Fields:

    "N:" & LastName & ";" & FirstName & "%0A": Specifies the structured name, with the last name followed by the first name.

    "FN:" & FirstName & " " & LastName & "%0A": Specifies the formatted name, combining the first name and last name.

  • Organization:

    "ORG:" & Account.Name & "%0A": Includes the organization (company) name.

  • Title:

    "TITLE:" & Title & "%0A": Includes the title (job title).

  • Phone Number:

    "TEL;TYPE=WORK,VOICE:" & Phone & "%0A": Specifies the work phone number.

  • Email Address:

    "EMAIL;TYPE=PREF,INTERNET:" & Email & "%0A": Specifies the preferred email address.

  • Address:

    "ADR;TYPE=WORK:;;" & MailingStreet & ";" & MailingCity & ";" & MailingState & ";" & MailingPostalCode & ";" & MailingCountry & "%0A": Specifies the work address, formatted as per vCard standards.

  • vCard End:

    "END:VCARD": Marks the end of the vCard data.

Formula Breakdown

Related Stories

Related Stories