{"id":25988,"date":"2020-12-10T12:31:08","date_gmt":"2020-12-10T12:31:08","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=25988"},"modified":"2020-12-10T12:31:08","modified_gmt":"2020-12-10T12:31:08","slug":"using-barcode-or-qr-code-scanner-control-in-custom-html-page-in-resco-mobile-app","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2020\/12\/using-barcode-or-qr-code-scanner-control-in-custom-html-page-in-resco-mobile-app\/","title":{"rendered":"Using Barcode or QR Code Scanner Control in Custom HTML Page in Resco Mobile App"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p style=\"text-align: justify;\">Recently we had a business requirement where we needed to scan the barcode\/QR Code of the <strong>Customer Asset<\/strong> entity record so it can show its information on the HTML page on the home screen of the Resco Mobile App. To achieve this, we followed the below steps:<\/p>\n<p>1. We developed an HTML Page with Javascript using the JSBridge reference file and added the following code to it.<\/p>\n<p><strong>Code Snippet:<\/strong><\/p>\n<p><strong>Html:<\/strong><\/p>\n<blockquote><p>&lt;div&gt;<br \/>\n&lt;label id=&#8221;lblHeading&#8221; class=&#8221;heading&#8221;&gt; Please click below button for using barcode \/ QR code scanner&lt;\/label&gt;<\/p>\n<p>&lt;br \/&gt;&lt;br \/&gt;<\/p>\n<p>&lt;img id=&#8221;leftTagScanner&#8221; onclick=&#8221;openBarcodeScanner(this);&#8221; class=&#8221;scan-icon&#8221; src=&#8221;Images\/scan.png&#8221; \/&gt;<br \/>\n&lt;\/div&gt;<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p><strong>Javascript:<\/strong><\/p>\n<blockquote><p>openBarcodeScanner = function (ctrl) {<\/p>\n<p>\/\/\/ &lt;summary&gt;<\/p>\n<p>\/\/\/ This function is used for opening barcode\/qrcode scanner to scan barcode\/qrcode details<\/p>\n<p>\/\/\/&lt;param&gt;ctrl&lt;\/param&gt;<\/p>\n<p>\/\/\/ &lt;\/summary&gt;<\/p>\n<p>var functionName = &#8220;openBarcodeScanner: &#8220;;<\/p>\n<p>try {<\/p>\n<p>\/\/Validate control<\/p>\n<p>if (isValid(ctrl)) {<\/p>\n<p>\/\/Open Barcode Scanner<\/p>\n<p>MobileCRM.Platform.scanBarCode(<\/p>\n<p>function (result) {<\/p>\n<p>if (isValid(result)) {<\/p>\n<p>\/\/Populate retrieved Barcode\/QRcode data<\/p>\n<p>MobileCRM.bridge.alert(&#8220;Retrieved Information: &#8221; + result);<\/p>\n<p>}<\/p>\n<p>},<\/p>\n<p>function (e) {<\/p>\n<p>MobileCRM.bridge.alert(&#8220;Error: &#8221; + functionName + e.message);<\/p>\n<p>});<\/p>\n<p>}<\/p>\n<p>} catch (e) {<\/p>\n<p>MobileCRM.bridge.alert(&#8220;Error: &#8221; + functionName + e.message);<\/p>\n<p>}<\/p>\n<p>}<\/p><\/blockquote>\n<p style=\"text-align: justify;\">We have used the \u201cMobileCRM.Platform.scanBarCode()\u201c JSBridge function for using Barcode\/QR code Scanner control from custom html page of Reco Mobile App.<br \/>\n<strong><em><br \/>\nNote: The \u201cresult\u201d parameter gets stored with the \u201cbarcode data\u201d in string format and the \u201cisValid()\u201d function is used for validation purposes only. You can use different validations in your code instead of using the \u201cisValid()\u201d function.<\/em><\/strong><\/p>\n<p style=\"text-align: justify;\">2. Then we have added this \u201cHTML\u201d file (with \u201cJavaScript\u201d code) in the \u201cIframe\u201d of the <strong>Home Page <\/strong>to show a custom HTML Page on the home screen of the Resco Mobile App and published the Resco Project.<\/p>\n<p>Please refer to the below screenshots,<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-1.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25992 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-1.png\" alt=\"Using Barcode or QR Code Scanner Control in Custom HTML Page in Resco Mobile App\" width=\"1313\" height=\"623\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-1.png 1313w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-1-300x142.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-1-768x364.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-1-1024x486.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-1-660x313.png 660w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">3. We synced the Resco Mobile App with the Resco Project, navigated to the \u201cCustom Scanner\u201d Menu, and clicked on the \u201cBarcode Scan Button\u201d. It opened a \u201cScanning Window\u201d on the Resco Mobile App.<\/p>\n<p>Please refer to the below screenshot,<br \/>\n<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-2.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25989 \" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-2.png\" alt=\"Using Barcode or QR Code Scanner Control in Custom HTML Page in Resco Mobile App\" width=\"531\" height=\"702\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-2.png 551w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-2-227x300.png 227w\" sizes=\"(max-width: 531px) 100vw, 531px\" \/><\/a><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-3.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25990 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-3.png\" alt=\"Using Barcode or QR Code Scanner Control in Custom HTML Page in Resco Mobile App\" width=\"531\" height=\"743\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-3.png 531w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-3-214x300.png 214w\" sizes=\"(max-width: 531px) 100vw, 531px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">4. After scanning the \u201cBarcode\u201d, it retrieved the data from that \u201cBarcode\u201d in the \u201cresult\u201d parameter. The data that was retrieved i.e. Barcode Details was in string format.<\/p>\n<p>Please refer to the below screenshot,<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-4.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25991 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-4.png\" alt=\"Using Barcode or QR Code Scanner Control in Custom HTML Page in Resco Mobile App\" width=\"552\" height=\"772\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-4.png 552w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Using-Barcode-or-QR-Code-Scanner-Control-in-Custom-HTML-Page-in-Resco-Mobile-App-4-215x300.png 215w\" sizes=\"(max-width: 552px) 100vw, 552px\" \/><\/a><\/p>\n<p>5. Finally, we used this retrieved data for displaying information on the Custom HTML Page.<\/p>\n<h2>Conclusion<\/h2>\n<p>We can use Barcode\/QRcode Scanner control in custom HTML pages, this will save the time of technicians for manually filling data on the form.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/kanban-board-dynamics-365-crm\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25994 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/1.jpg\" alt=\"Kanban Board\" width=\"800\" height=\"200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/1.jpg 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/1-300x75.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/1-768x192.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/1-660x165.jpg 660w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Recently we had a business requirement where we needed to scan the barcode\/QR Code of the Customer Asset entity record so it can show its information on the HTML page on the home screen of the Resco Mobile App. To achieve this, we followed the below steps: 1. We developed an HTML Page with\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2020\/12\/using-barcode-or-qr-code-scanner-control-in-custom-html-page-in-resco-mobile-app\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[16,18,19,24,48],"tags":[193,545,592,1440,1445,1446,1448,1450],"class_list":["post-25988","post","type-post","status-publish","format-standard","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-dynamics-crm","category-dynamics-crm-2016","category-resco-mobile-crm","tag-barcode-scanner-control-dynamics-365","tag-dynamics-365-crm","tag-dynamics-crm","tag-resco-app","tag-resco-mobile-app","tag-resco-mobile-app-dynamics-365-crm","tag-resco-mobile-crm-app","tag-resco-mobile-dynamics-crm-app"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/25988","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=25988"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/25988\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=25988"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=25988"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=25988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}