+ Start a Discussion
Yash SadeghiYash Sadeghi 

Navigate to record through barcode


I created a Visualforce Page for a button on my Salesforce1 app in order to navigate me to a record after a barcode has been identified by my camera. In saying so, I want the barcode to be referenced to a SF ID in order to compare if a barcode (record) like that already exists.

Everything has been set up and I started out like this for my Visualforce page, but I am not sure how to properly navigate to a record, I would appreciate any help and advice: 

<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"/>
        <div style="font-family: sans-serif; text-align: center">
            Tap icon above to scan a piece of furniture

        var furnitureRedirectUrl = "sforce.one.navigateToSObject(a0D58000004LFMm, detail)";
        var a = document.getElementById("link");
        a.href = 'pic2shop://scan?callback=' + encodeURIComponent(furnitureRedirectUrl);        

thanks in advance !