{"id":13904,"date":"2019-01-04T11:38:54","date_gmt":"2019-01-04T11:38:54","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=13904"},"modified":"2019-01-04T11:38:54","modified_gmt":"2019-01-04T11:38:54","slug":"custom-commands-in-resco-mobile-app","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2019\/01\/custom-commands-in-resco-mobile-app\/","title":{"rendered":"Custom Commands in Resco Mobile App"},"content":{"rendered":"<p><strong>Introduction:<\/strong><\/p>\n<p style=\"text-align: justify;\">Commands in Resco mobile app allow certain actions throughout the whole form. The main principle is to create a command in Woodford, but the logic that need to be performed on execute of the command can be defined in the JavaScript.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-13905\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/01\/1Custom-Commands-in-Resco-Mobile-App.png\" alt=\"Custom Commands in Resco Mobile App\" width=\"819\" height=\"624\" \/><\/p>\n<p style=\"text-align: justify;\">Let\u2019s consider an example, on \u201cWork Order\u201d user wants a custom command to \u201cClose &#8211; Posted\u201d the work order from Resco App.<\/p>\n<p>Below will be the steps in order to add custom command for Close Posting the work order:<\/p>\n<p><strong>1<\/strong>. Open \u201cResco woodford\u201d application. Navigate to \u201cWork Order\u201d entity\u2019s Edit Form and click on \u201cEdit\u201d.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-13906\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/01\/2Custom-Commands-in-Resco-Mobile-App.png\" alt=\"Custom Commands in Resco Mobile App\" width=\"815\" height=\"492\" \/><\/p>\n<p><strong>2<\/strong>.\u00a0Click on \u201cNew Command\u201d and mention name of the command.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-13907\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/01\/3Custom-Commands-in-Resco-Mobile-App.png\" alt=\"Custom Commands in Resco Mobile App\" width=\"817\" height=\"608\" \/><\/p>\n<p style=\"text-align: justify;\"><strong>3<\/strong>.\u00a0Command is created, so in order to bind the action that need to performed using JavaScript or also by using OnExecute button in Woodford. Here we will try using both JavaScript as well as OnExecute. Next step will be adding Html with script on \u201cWork Order\u201d form.<\/p>\n<p style=\"text-align: justify;\"><strong>4<\/strong>. Upload the HTML and JavaScript in the offline Html section in Woodford by clicking on the \u201cUpload\u201d button as shown in the below screenshot.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-13908\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/01\/4Custom-Commands-in-Resco-Mobile-App.png\" alt=\"Custom Commands in Resco Mobile App\" width=\"819\" height=\"532\" \/><\/p>\n<p style=\"text-align: justify;\"><strong>5<\/strong>. Click on Add IFrame &gt;&gt; Browse to select the html to be added on the form. Refer the below screenshot for the same.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-13909\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/01\/5Custom-Commands-in-Resco-Mobile-App.png\" alt=\"Custom Commands in Resco Mobile App\" width=\"933\" height=\"582\" \/><\/p>\n<p><strong>6<\/strong>. Select the HTML page having javascript code to save and close the current record.<\/p>\n<p>&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html xmlns=&#8221;http:\/\/www.w3.org\/1999\/xhtml&#8221;&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;title&gt;&lt;\/title&gt;<\/p>\n<p>&lt;meta charset=&#8221;utf-8&#8243; \/&gt;<\/p>\n<p>&lt;meta http-equiv=&#8221;X-UA-Compatible&#8221; content=&#8221;IE=edge&#8221; \/&gt;<\/p>\n<p>&lt;meta name=&#8221;viewport&#8221; content=&#8221;initial-scale=1, user-scalable=no&#8221; \/&gt;<\/p>\n<p>&lt;script src=&#8221;Scripts\/JSBridge.js&#8221;&gt;&lt;\/script&gt;<\/p>\n<p>&lt;script type=&#8221;text\/javascript&#8221;&gt;<\/p>\n<p>function onLoad() {<\/p>\n<p>var functionName = &#8220;FnLoad&#8221;;<\/p>\n<p>try {<\/p>\n<p>MobileCRM.UI.EntityForm.onCommand(&#8220;custom_ClosePostWorkOrder&#8221;,<\/p>\n<p>function (entityForm) {<\/p>\n<p>if (entityForm)<\/p>\n<p>MobileCRM.UI.EntityForm.saveAndClose();<\/p>\n<p>}<\/p>\n<p>);<\/p>\n<p>}<\/p>\n<p>catch (e) {<\/p>\n<p>throw new MobileCrmException(functionName + e.message);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>&lt;\/script&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body onload=&#8221;onLoad();&#8221;&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p style=\"text-align: justify;\"><strong>7<\/strong>. Now, on \u201cWork Order\u201d entity\u2019s Edit form, click on Edit. Click on \u201cOnExecute\u201d and add step to change the \u201cSystem Status\u201d of Work order as \u201cClose Posted\u201d.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-13910\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/01\/6Custom-Commands-in-Resco-Mobile-App.png\" alt=\"Custom Commands in Resco Mobile App\" width=\"963\" height=\"550\" \/><\/p>\n<p><strong>8<\/strong>. Save and Publish the Woodford solution.<\/p>\n<p style=\"text-align: justify;\"><strong>9<\/strong>. In Resco app, open \u201cWork Order\u201d record. Click on \u201cClose Post Work Order\u201d. This will change the \u201cSystem Status\u201d to \u201cClose- Posted\u201d, also save and close the \u201cwork order\u201d record.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-13914\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/01\/7Custom-Commands-in-Resco-Mobile-App-1.png\" alt=\"Custom Commands in Resco Mobile App\" width=\"907\" height=\"513\" \/><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-13915\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/01\/8Custom-Commands-in-Resco-Mobile-App-1.png\" alt=\"Custom Commands in Resco Mobile App\" width=\"817\" height=\"348\" \/><\/p>\n<p><strong>Conclusion:<\/strong><\/p>\n<p>Using the simple steps given above user can easily create Custom Commands in Resco Mobile App.<\/p>\n<p><strong><em>Read our blog series on <a href=\"https:\/\/www.inogic.com\/blog\/?s=Resco+Mobile+CRM\" target=\"_blank\" rel=\"noopener noreferrer\">Resco Mobile CRM<\/a><\/em><\/strong><\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/integrations\/inolink-quickbooks-microsoft-dynamics-crm\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter  wp-image-13918\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/01\/InoLink-QuickBooks-Integration-with-Microsoft-Dynamics-365-Dynamics-CRM.jpg\" alt=\"InoLink-QuickBooks-Integration-with-Microsoft-Dynamics-365-Dynamics-CRM\" width=\"817\" height=\"101\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Commands in Resco mobile app allow certain actions throughout the whole form. The main principle is to create a command in Woodford, but the logic that need to be performed on execute of the command can be defined in the JavaScript. Let\u2019s consider an example, on \u201cWork Order\u201d user wants a custom command to\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2019\/01\/custom-commands-in-resco-mobile-app\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":13913,"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,48],"tags":[1440,1447,1448],"class_list":["post-13904","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-dynamics-crm","category-resco-mobile-crm","tag-resco-app","tag-resco-mobile-crm","tag-resco-mobile-crm-app"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/13904","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=13904"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/13904\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/13913"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=13904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=13904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=13904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}