{"id":197,"date":"2009-06-08T04:43:00","date_gmt":"2009-06-07T23:13:00","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=197"},"modified":"2009-06-08T04:43:00","modified_gmt":"2009-06-07T23:13:00","slug":"call-workflow-from-isv-button","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2009\/06\/call-workflow-from-isv-button\/","title":{"rendered":"Call Workflow from ISV button"},"content":{"rendered":"<p>We had once given an option to one of our customers to perform an action using on-demand workflow. We provided them with the steps to run the workflow from the &#8220;Run Workflow&#8230;&#8221; button that is added to the entity in case and entity has on-demand workflows published against them.<br \/>\nThe customer however wanted that we add a button with a descriptive lable that performed the job so that the users are not burdened with having to select the correct workflow from the list and it was a one-click solution.<br \/>\nWe found that CRM has an inbuilt function made available that calls the workflow &#8220;<strong>launchOnDemandWorkflow<\/strong>&#8221;<br \/>\nThe syntax of the function is<br \/>\nlaunchOnDemandWorkflow(&#8216;crmGrid&#8217;,ObjectTypeCode,Workflow ID) \/\/when called from grid<br \/>\nlaunchOnDemandWorkflow(&#8221;,ObjectTypeCode,Workflow ID) \/\/when called from entity form<br \/>\nThis function has 3 parameters.<br \/>\nThe first one is left blank only if the button is on the record of that entity and workflow needs to be called on that record only. whereas, if the button is placed on the grid of CRM entity view then first parameter should be &#8216;<strong>crmGrid<\/strong>&#8216; so that the workflow will get called for the records selected in that view.<br \/>\nSecond parameter contains <strong>object type code <\/strong>of that entity<br \/>\nThird parameter is the <strong>id of the workflow<\/strong> to be fired<br \/>\n<strong>To get the workflow id, follow the below steps.<br \/>\n<\/strong><br \/>\n1. Go to Setting &#8211;&gt; Workflow form.<br \/>\n2. Here open the workflow that you want to run on button click.<br \/>\n3. Now press &#8220;Ctrl + N&#8221; which will open the same page in the IE.<br \/>\n4. In the Address bar of IE you can find the id of workflow.<br \/>\nThis should help provide users with the most familiar option of clicking a button to perform an action.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We had once given an option to one of our customers to perform an action using on-demand workflow. We provided them with the steps to run the workflow from the &#8220;Run Workflow&#8230;&#8221; button that is added to the entity in case and entity has on-demand workflows published against them. The customer however wanted that we\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2009\/06\/call-workflow-from-isv-button\/\">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":[67],"tags":[1555,1620],"class_list":["post-197","post","type-post","status-publish","format-standard","hentry","category-workflows","tag-scripting","tag-shortcuts"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/197","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=197"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/197\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}