{"id":3728,"date":"2013-04-20T06:36:18","date_gmt":"2013-04-20T06:36:18","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagecrm\/?p=3728"},"modified":"2013-04-20T06:36:18","modified_gmt":"2013-04-20T06:36:18","slug":"confirmation-dialog-box-in-workflow-action-button-of-sage-crm","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/","title":{"rendered":"Confirmation dialog box in workflow action button of Sage CRM"},"content":{"rendered":"<p>Recently, one of our clients came up with a new requirement. Requirement was to show confirmation dialog box (OK\u00a0Cancel Popup), on workflow action button. Here, if user clicks on\u00a0<strong>OK<\/strong>\u00a0then it proceed further with action; clicking on <strong>No<\/strong> terminate the action.<br \/>\nIt will be clear, if explained the same with actual scenario. We have action button with name <strong>Send Mail<\/strong> in Opportunity workflow. When User clicks on Send Mail button, Email is fired to the respective client, sometimes an email is sent to sender if workflow rule is clicked by mistake. Therefore, to avoid this sort of situation, client requested to add confirmation dialog box on Send Mail button.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2013\/04\/1.-Actions.png\" target=\"_blank\"><img decoding=\"async\" class=\"aligncenter  wp-image-3729\" title=\"Actions\" src=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2013\/04\/1.-Actions.png\" alt=\"\" width=\"156\" height=\"241\" \/><\/a><\/p>\n<p>Whenever user clicks on <strong>Send Mail\u00a0<\/strong>button dialog box gets displayed.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2013\/04\/2.-Message.png\" target=\"_blank\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter  wp-image-3730\" title=\"Message\" src=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2013\/04\/2.-Message.png\" alt=\"\" width=\"743\" height=\"299\" \/><\/a><\/p>\n<p>To achieve this requirement we thought JavaScript is the best option. Here, we have added below code in CustomeContent of OpportunityWebPicker screen;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&lt;snip&gt;<\/p>\n<p style=\"text-align: left;\">&lt;script language=&#8221;javascript&#8221; src=&#8221;..\/CustomPages\/ClientFuncs.js&#8221;&gt;<br \/>\n&lt;\/script&gt;<br \/>\n&lt;script&gt;<br \/>\nif (typeof window.addEventListener != &#8216;undefined&#8217;)<br \/>\n{<br \/>\nwindow.addEventListener(&#8220;load&#8221;, WorkflowOnload, false);<br \/>\n}<br \/>\nelse if (window.attachEvent)<br \/>\n{<br \/>\nwindow.attachEvent(&#8220;onload&#8221;, WorkflowOnload)<br \/>\n}<br \/>\n&lt;\/script&gt;<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&lt;\/snip&gt;<br \/>\nWell, next step is to add actual JavaScript which show the dialog box. Here we have created new custom JavaScript file (ClientFuncs.js) and added below code in it. Then, saved this file in\u00a0 &#8230;\/wwwRoot\/<strong>Custompages<\/strong> folder. Here, all customization is completed;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&lt;snip&gt;<br \/>\n<span style=\"line-height: 1.6em;\">function GetWorkflowButton()<\/span><br \/>\n{<br \/>\nvar tblobj = document.getElementsByTagName(&#8220;A&#8221;);<br \/>\nfor(i=0;i&lt;tblobj.length; i++)<br \/>\n{<br \/>\nif(tblobj[i].className == &#8220;WFBUTTON&#8221;)<br \/>\n{<br \/>\nLinktoSearch = tblobj[i].innerHTML<br \/>\nvar sURLOld=tblobj[i].href<br \/>\nif(LinktoSearch.search(&#8220;WorkflowDefault.gif&#8221;)&gt;0 || tblobj[i].innerText==&#8221;SendMail&#8221;)<br \/>\n{<br \/>\ntblobj[i].href = &#8220;javascript:OnClickFollowUp(&#8216;&#8221;+sURLOld+&#8221;&#8216;)&#8221;;<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\nfunction OnClickFollowUp(pmURL)<br \/>\n{<br \/>\nvar delconfirmtn = confirm(&#8220;Are you sure you want to send the mail to the client&#8221;);<br \/>\nif(delconfirmtn)<br \/>\n{<br \/>\ndocument.location.href= pmURL;<br \/>\n}<br \/>\nelse<br \/>\n{}<br \/>\n}<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&lt;\/snip&gt;<br \/>\nOnce done,\u00a0Logout\u00a0and re-login to Sage CRM and navigate to customized screen and check when user clicks on Send Mail button; Confirmation dialog will box gets popped up. When user click on\u00a0OK\u00a0button Email gets fired and clicking on cancel button action gets terminated.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, one of our clients came up with a new requirement. Requirement was to show confirmation dialog box (OK\u00a0Cancel Popup), on workflow action button. Here, if user clicks on\u00a0OK\u00a0then it proceed further with action; clicking on No terminate the action. It will be clear, if explained the same with actual scenario. We have action button\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[332],"tags":[1042,2010,2604],"class_list":["post-3728","post","type-post","status-publish","format-standard","hentry","category-sage-crm","tag-email","tag-sage-crm","tag-workflow"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Confirmation dialog box in workflow action button of Sage CRM - Sage CRM \u2013 Tips, Tricks and Components<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Confirmation dialog box in workflow action button of Sage CRM - Sage CRM \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"og:description\" content=\"Recently, one of our clients came up with a new requirement. Requirement was to show confirmation dialog box (OK\u00a0Cancel Popup), on workflow action button. Here, if user clicks on\u00a0OK\u00a0then it proceed further with action; clicking on No terminate the action. It will be clear, if explained the same with actual scenario. We have action button\u2026 Read More &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/\" \/>\n<meta property=\"og:site_name\" content=\"Sage CRM \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"article:published_time\" content=\"2013-04-20T06:36:18+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2013\/04\/1.-Actions.png\" \/>\n<meta name=\"author\" content=\"greysagecrm\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"greysagecrm\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/\",\"name\":\"Confirmation dialog box in workflow action button of Sage CRM - Sage CRM \u2013 Tips, Tricks and Components\",\"isPartOf\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2013\/04\/1.-Actions.png\",\"datePublished\":\"2013-04-20T06:36:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#\/schema\/person\/e7ff1c8f4763b47730d6bc5e74d59c1f\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/#primaryimage\",\"url\":\"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2013\/04\/1.-Actions.png\",\"contentUrl\":\"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2013\/04\/1.-Actions.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Confirmation dialog box in workflow action button of Sage CRM\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#website\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/\",\"name\":\"Sage CRM \u2013 Tips, Tricks and Components\",\"description\":\"Explore the possibilities with Sage CRM insights through our comprehensive blogs. As a leading Sage partner, Greytrix helps businesses maximize their Sage CRM potential with its rich expertise and immense knowledge. Here, you will find blogs that feature expert advice, tips &amp; tricks, best practices, and comprehensive guides on customizing and configuring Sage CRM for your business. Stay informed with our regular updates and expert insights!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#\/schema\/person\/e7ff1c8f4763b47730d6bc5e74d59c1f\",\"name\":\"greysagecrm\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g\",\"caption\":\"greysagecrm\"},\"url\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/author\/greysagecrm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Confirmation dialog box in workflow action button of Sage CRM - Sage CRM \u2013 Tips, Tricks and Components","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/","og_locale":"en_US","og_type":"article","og_title":"Confirmation dialog box in workflow action button of Sage CRM - Sage CRM \u2013 Tips, Tricks and Components","og_description":"Recently, one of our clients came up with a new requirement. Requirement was to show confirmation dialog box (OK\u00a0Cancel Popup), on workflow action button. Here, if user clicks on\u00a0OK\u00a0then it proceed further with action; clicking on No terminate the action. It will be clear, if explained the same with actual scenario. We have action button\u2026 Read More &raquo;","og_url":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/","og_site_name":"Sage CRM \u2013 Tips, Tricks and Components","article_published_time":"2013-04-20T06:36:18+00:00","og_image":[{"url":"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2013\/04\/1.-Actions.png","type":"","width":"","height":""}],"author":"greysagecrm","twitter_card":"summary_large_image","twitter_misc":{"Written by":"greysagecrm","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/","url":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/","name":"Confirmation dialog box in workflow action button of Sage CRM - Sage CRM \u2013 Tips, Tricks and Components","isPartOf":{"@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/#primaryimage"},"image":{"@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/#primaryimage"},"thumbnailUrl":"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2013\/04\/1.-Actions.png","datePublished":"2013-04-20T06:36:18+00:00","author":{"@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#\/schema\/person\/e7ff1c8f4763b47730d6bc5e74d59c1f"},"breadcrumb":{"@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/#primaryimage","url":"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2013\/04\/1.-Actions.png","contentUrl":"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2013\/04\/1.-Actions.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2013\/04\/20\/confirmation-dialog-box-in-workflow-action-button-of-sage-crm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/"},{"@type":"ListItem","position":2,"name":"Confirmation dialog box in workflow action button of Sage CRM"}]},{"@type":"WebSite","@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#website","url":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/","name":"Sage CRM \u2013 Tips, Tricks and Components","description":"Explore the possibilities with Sage CRM insights through our comprehensive blogs. As a leading Sage partner, Greytrix helps businesses maximize their Sage CRM potential with its rich expertise and immense knowledge. Here, you will find blogs that feature expert advice, tips &amp; tricks, best practices, and comprehensive guides on customizing and configuring Sage CRM for your business. Stay informed with our regular updates and expert insights!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#\/schema\/person\/e7ff1c8f4763b47730d6bc5e74d59c1f","name":"greysagecrm","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g","caption":"greysagecrm"},"url":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/author\/greysagecrm\/"}]}},"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/posts\/3728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/comments?post=3728"}],"version-history":[{"count":0,"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/posts\/3728\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/media?parent=3728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/categories?post=3728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/tags?post=3728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}