function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Yash SadeghiYash Sadeghi 

Creating a barcode scanner

Hello, I wanted to make sure that when I take a picture of a barcode, its going to appear on a referenced field on my Salesforce1 app. I am using pic2shop in order to achieve that. So far I want the barcode to remain in my Salesforce1 application after the picture has been taken by the camera via pictoshop,

Barcode Scanner

The only problem is after the code has been scanned I simply return to this page

User-added image

This is the icon we click on before we can perform a scan. 


For this function I created a button with a Visualforce Page:

<apex:page standardController="Furniture__c">
     <div style="width: 30%">
        <a id="link" href="#" style="text-decoration: none">
            <img style="background: blue; display: block; margin: auto;" width="80%" src="/img/icon/t4v35/standard/product.svg"/>
            <br/>
        </a>
        
        <div style="font-family: sans-serif; text-align: center">
            Tap icon above to scan a piece of furniture
        </div>
    </div>    
    <script>
  


        var furnitureRedirectUrl = "com.salesforce.salesforce1://furniture__c/view?furniture__cid=a0D58000004LIbK";     //Ref to Application, Object/Record (Furniture__c/a0D58000004LIbK/edit)
        var a = document.getElementById("link");  
        a.href = "pic2shop://scan?callback=" + encodeURIComponent(furnitureRedirectUrl);         
           
    </script>



I would appreciate any kind of help, I tried several approaches, even tried the Pro Version of pic2shop but I'm not getting anywhere.



Thank you !