Mobile Application based on phonegap is used to perform two major functions:
- It Scans a barcode and if there exists a record with that barcode in an object then it updates some fields of that object.
- It Scans a barcode and if there exists no record with that barcode then it creates a record for it.
To Scan a barcode and if there exists a record with that barcode in an object then update Donation Amount (fieldname of that object) and if there exists no record with that barcode then it shows an alert “can not update Donation Amount”.
- Login using salesforce credentials to your app.
- Click on Scan Barcode button
- Further Barcode scanner will open , you can now scan a particular barcode.
- If there exists a Contact record related to barcode which is scanned a pop window will open where you can update donation amount.
- Further you can logout of this app using Logout Button
In Barcode Scanner App we use connected app and Jsforce plugin
- Connected App
A connected app is an application that connect to Salesforce.com over identity and data API’s. Connected Apps use the standard OAuth 2.0 protocol to authenticate, provide Single Sign-On, and acquire access tokens for use with Salesforce APIs.
Connected App Name - Barcode Scanner
- Jsforce plugin
- Login and Logout
Allow the user to logout of the app , and then login as a different user without any Problems
We were able to achieve a solution where we are able to match the records in salesforce from mobile app using the Barcode as a unique property and did update or creation based on that. Customer was happy and got the solution to their requirement.