For Lightning Components
METHOD 1:
There are three steps to display the barcode on your standard record detail page:
- Add a custom field into the object which you want to display the
- Create a visual force page to generate the
- Add the visual force page into the page layout.
Step1: Create a custom picklist field
Example: Barcode Type with the values listed below.
- code128
- code39
- ean13
- ean8
- qrcode
- pdf417
Step 2: Create a Visualforce Page.
Note: Please re-type the single and double quotes in the Visualforce page code.
Example: For custom controller or extension:
For e.g., our case, we create a new Visualforce Page and add the below code for standard controller:
Attribute Name | Attribute Type | Description |
barvalue | String | Barcode value for which the barcode will be generated |
barType | String | Type of the barcode to be generated |
ILLUSTRATIONS
- Select any Product from the Product list or create a new
- Enter the ‘Barcode Value’ to be generated and select the ‘Barcode Type’.
Example 1:
Barcode Value is “AQXOLT” and Barcode Type is “code39”.
Example 2:
Barcode Value is “AQXOLT” and Barcode Type is “code128”.
Example 3:
Barcode Value is “9780201734843” and Barcode Type is “ean13”.
Example 4:
Barcode Value is “83939399” and Barcode Type is “ean8”.
Example 5:
Barcode Value is “AQXOLT” and Barcode Type is “qrcode”.
Example 6:
Barcode Value is “83939399” and Barcode Type is “pdf417”.