{"id":21279,"date":"2019-12-02T11:41:24","date_gmt":"2019-12-02T11:41:24","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=21279"},"modified":"2019-12-02T11:41:24","modified_gmt":"2019-12-02T11:41:24","slug":"how-to-use-custom-commands-on-entity-lists-in-resco-mobile-app","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2019\/12\/how-to-use-custom-commands-on-entity-lists-in-resco-mobile-app\/","title":{"rendered":"How to Use Custom Commands on Entity Lists in Resco Mobile App"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Recently, we had a business requirement where we wanted to change the status of <strong>Bookable Resource Booking<\/strong> record from \u2018Entity List\u2019 in Resco mobile app. So, in order to achieve this functionality we have used \u2018Custom Command\u2019 of \u2018Entity List\u2019.<\/p>\n<p>Follow the steps given below to add \u2018Custom Command\u2019 on the \u2018Entity List\u2019.<\/p>\n<p><strong>1<\/strong>. Navigate to the entity (e.g. Bookable Resource Booking) in Woodford Configuration Tool, open \u2018Entity List\u2019 (for which you want to add a \u2018Custom Command\u2019) and click on the \u2018Buttons\u2019 in order to open Commands window.<\/p>\n<p>Please refer below screenshots:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-21288\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/1How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App.png\" alt=\"How to Use Custom Commands on Entity Lists in Resco Mobile App\" width=\"880\" height=\"709\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/1How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App.png 789w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/1How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-300x241.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/1How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-768x618.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/1How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-660x531.png 660w\" sizes=\"(max-width: 880px) 100vw, 880px\" \/><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21287\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/2How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App.png\" alt=\"How to Use Custom Commands on Entity Lists in Resco Mobile App\" width=\"928\" height=\"620\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/2How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App.png 928w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/2How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-300x200.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/2How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-768x513.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/2How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-660x441.png 660w\" sizes=\"(max-width: 928px) 100vw, 928px\" \/><\/p>\n<p><strong>2<\/strong>. Then click on \u2018New Command\u2019 button in order to add new Command for that \u2018Entity List\u2019, and provide an appropriate name for the same (e.g. custom_ChangeStatus).<br \/>\nPlease refer below screenshot:<\/p>\n<p><img decoding=\"async\" class=\" wp-image-21286 alignnone\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/3How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App.png\" alt=\"How to Use Custom Commands on Entity Lists in Resco Mobile App\" width=\"1133\" height=\"820\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/3How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App.png 599w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/3How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-300x217.png 300w\" sizes=\"(max-width: 1133px) 100vw, 1133px\" \/><\/p>\n<p><strong>3<\/strong>. Develop a HTML file with Java Script code for updating status of <strong>Bookable Resource Booking<\/strong> entity record.<\/p>\n<blockquote><p><strong><em>Note: While developing, you will need to use \u2018JSBridge reference file\u2019 and use its MobileCRM.UI.EntityList.onCommand(&#8220;custom_ChangeStatus&#8221;, function (entityList){} funtion in order to get access to all the Resco Functions<\/em><\/strong>.<\/p><\/blockquote>\n<p>Code snippet:<\/p>\n<pre class=\"lang:default decode:true \"> &lt;!DOCTYPE html&gt;\r\n\r\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;title&gt;&lt;\/title&gt;\r\n\r\n&lt;meta charset=\"utf-8\" \/&gt;\r\n\r\n&lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" \/&gt;\r\n\r\n&lt;meta name=\"viewport\" content=\"initial-scale=1, user-scalable=no\" \/&gt;\r\n\r\n\u00a0\r\n\r\n&lt;link href=\"CSS\/bootstrap.css\" rel=\"stylesheet\" \/&gt;\r\n\r\n&lt;script src=\"JSBridge.js\"&gt;&lt;\/script&gt;\r\n\r\n&lt;script type=\"text\/javascript\"&gt;\r\n\r\nvar brbRecord = null;\r\n\r\nvar brbID = null;\r\n\r\nfunction fnLoad() {\r\n\r\ntry {\r\n\r\n\u00a0\r\n\r\n\/\/function to capture command of Bookable Resource Booking entity list\r\n\r\nMobileCRM.UI.EntityList.onCommand(\"custom_ChangeStatus\", function (entityList) {\r\n\r\n\u00a0\r\n\r\n\/\/Storing id of the record on which command is executed\r\n\r\nbrbID = entityList.context.entities[0].id != null ? entityList.context.entities[0].id : null;\r\n\r\n\u00a0\r\n\r\n\/\/Check if Bookable Resource Booking contains data\r\n\r\nif (brbID != null) {\r\n\r\n\u00a0\r\n\r\n\/\/Load Bookable Resource Booking record using id\r\n\r\nMobileCRM.DynamicEntity.loadById(\"bookableresourcebooking\", brbID, function (Entity) {\r\n\r\n\u00a0\r\n\r\n\/\/Set Booking as In-Progress\r\n\r\nEntity.properties.bookingstatus = new MobileCRM.Reference(\"bookingstatus\", \"53F39908-D08A-4D9C-90E8-907FD7BEC07D\", \"In Progress\");\r\n\r\n\u00a0\r\n\r\n\/\/Set Actual Arrival Time\r\n\r\nEntity.properties.msdyn_actualarrivaltime = new Date();\r\n\r\n\u00a0\r\n\r\n\/\/Save the Bookable Resource Booking record\r\n\r\nEntity.save(\r\n\r\nfunction (err) {\r\n\r\nif (!err) {\r\n\r\n\/\/ store the Bookable Resource Booking id for further use\r\n\r\nvar brbID = this.id;\r\n\r\n}\r\n\r\nelse\r\n\r\nMobileCRM.bridge.alert(\" An Error Has occurred \\n\" + err);\r\n\r\n}, null);\r\n\r\n})\r\n\r\n}\r\n\r\n});\r\n\r\n\u00a0\r\n\r\n} catch (e) {\r\n\r\nMobileCRM.bridge.alert(\"An Error Has occurred \" + e);\r\n\r\n}\r\n\r\n}\r\n\r\n\u00a0\r\n\r\n&lt;\/script&gt;\r\n\r\n\u00a0\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body onload=\"fnLoad();\"&gt;\r\n\r\n\u00a0\r\n\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;<\/pre>\n<p><strong>4<\/strong>. Then add this HTML File (with Java Script Code) in \u2018Offline HTML\u2019 section of Woodford.<br \/>\nPlease refer below screenshot:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-21285\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/4How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-1.png\" alt=\"How to Use Custom Commands on Entity Lists in Resco Mobile App\" width=\"1098\" height=\"773\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/4How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-1.png 646w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/4How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-1-300x211.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/4How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-1-200x140.png 200w\" sizes=\"(max-width: 1098px) 100vw, 1098px\" \/><\/p>\n<p><strong>5<\/strong>. After uploading the HTML File, add an \u2018IFrame\u2019 on the \u2018Entity List\u2019 of <strong>Bookable Resource Booking <\/strong>entity<strong>.<br \/>\n<\/strong>Please refer below screenshots:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21283\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/5How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App.png\" alt=\"How to Use Custom Commands on Entity Lists in Resco Mobile App\" width=\"1009\" height=\"544\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/5How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App.png 1009w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/5How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-300x162.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/5How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-768x414.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/5How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-660x356.png 660w\" sizes=\"(max-width: 1009px) 100vw, 1009px\" \/><\/p>\n<p style=\"padding-left: 160px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-21282\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/6How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App.png\" alt=\"How to Use Custom Commands on Entity Lists in Resco Mobile App\" width=\"402\" height=\"301\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/6How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App.png 402w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/6How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-300x225.png 300w\" sizes=\"(max-width: 402px) 100vw, 402px\" \/><\/p>\n<p><strong>6<\/strong>. After adding the \u2018IFrame\u2019 on \u2018Entity List\u2019, save the \u2018Entity List\u2019 and publish the Resco Project on 11.2 or higher version.<br \/>\nPlease refer below screenshot:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-21281\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/7How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App.png\" alt=\"How to Use Custom Commands on Entity Lists in Resco Mobile App\" width=\"1173\" height=\"1014\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/7How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App.png 675w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/7How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-300x259.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/7How-to-Use-Custom-Commands-on-Entity-Lists-in-Resco-Mobile-App-660x570.png 660w\" sizes=\"(max-width: 1173px) 100vw, 1173px\" \/><\/p>\n<p>&nbsp;<\/p>\n<blockquote><p><strong><em>Note: The Custom Commands of the Entity Lists are only supported in Woodford Version 11.2 and higher.<\/em><\/strong><\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p><strong>7<\/strong>. Then sync the Resco Mobile App with Dynamics 365 CRM.<\/p>\n<p><strong>8<\/strong>. Once the Resco Mobile App is synced, navigate to the <strong>Bookable Resource Booking <\/strong>entity, Swipe Left on any record and click the \u2018Start\u2019 button to update the record.<br \/>\nPlease refer below screenshots:<\/p>\n<p style=\"padding-left: 40px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-21280\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/8Resco.jpg\" alt=\"Resco\" width=\"531\" height=\"333\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/8Resco.jpg 531w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/8Resco-300x188.jpg 300w\" sizes=\"(max-width: 531px) 100vw, 531px\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>As illustrated above, you can now add your own Custom Buttons on Entity Lists using Custom Commands.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/add-manage-schedule-notifications-alerts-4-dynamics-365-crm\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-21291\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/A4D.jpg\" alt=\"Dynamics 365 Alerts\" width=\"884\" height=\"221\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/A4D.jpg 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/A4D-300x75.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/A4D-768x192.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/12\/A4D-660x165.jpg 660w\" sizes=\"(max-width: 884px) 100vw, 884px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Recently, we had a business requirement where we wanted to change the status of Bookable Resource Booking record from \u2018Entity List\u2019 in Resco mobile app. So, in order to achieve this functionality we have used \u2018Custom Command\u2019 of \u2018Entity List\u2019. Follow the steps given below to add \u2018Custom Command\u2019 on the \u2018Entity List\u2019. 1.\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2019\/12\/how-to-use-custom-commands-on-entity-lists-in-resco-mobile-app\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":21290,"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":[48],"tags":[1445,1447],"class_list":["post-21279","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-resco-mobile-crm","tag-resco-mobile-app","tag-resco-mobile-crm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/21279","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=21279"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/21279\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/21290"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=21279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=21279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=21279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}