{"id":10683,"date":"2020-09-30T15:48:18","date_gmt":"2020-09-30T21:48:18","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/techblog\/?p=10683"},"modified":"2024-11-07T13:49:13","modified_gmt":"2024-11-07T19:49:13","slug":"workflow-statuses-refresh","status":"publish","type":"ht_kb","link":"https:\/\/www.mrc-productivity.com\/techblog\/?ht_kb=workflow-statuses-refresh","title":{"rendered":"Workflow Statuses &#8211; Configuring page refresh with status changes"},"content":{"rendered":"\n<p>The Workflow Statuses functionality as outlined <a href=\"\/docs\/maint\/workflow-statuses\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> allows end-users to easily progress a defined status field from the click of a button in read-only applications like a Multiple Row retrieval. However users of the status buttons or pulldown menu options may have noticed that changing the underlying status does not refresh the entire dataset displayed on screen. Without having to use the browser&#8217;s refresh functionality each time, m-Power users have asked how to simultaneously reload the data to show any unrelated data changes to other columns values when the status has been progressed.<\/p>\n\n\n\n<p>For example, in the image below the column titled &#8216;Update Status?&#8217; will change the order status field appropriately to processed, shipped, delivered, etc. in the database (as indicated by the colored status badge). However if any other details regarding the order have changed, like the order date or the amount, this information will not be reflected until the application is reloaded completely in the browser.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/techblog\/images\/status1.jpg\" alt=\"Retrieval with Status Buttons\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>To address this, open m-Painter (via source view) in the Multiple Row retrieval that has the Workflow Status buttons or pulldown menu options. Before the ending  tag near the top of the HTML file, insert the following script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script>\n   jQuery(function(){\n       jQuery('body').on('mrc:statusRefresh',function(){\n           window.location.reload();\n       });\n   });\n&lt;\/script><\/code><\/pre>\n\n\n\n<p>Now when a end-user progresses an order status, the aforementioned script will perform an unobtrusive and instantaneously page reload and any records that have been modified in the dataset will be reflected with their current values.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/techblog\/images\/status2.jpg\" alt=\"Retrieval after script worked in\"\/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Workflow Statuses functionality as outlined here allows end-users to easily progress a defined status field from the click of a button in read-only applications like a Multiple Row retrieval. However users of the status buttons or pulldown menu options may have noticed that changing the underlying status does not&#8230;<\/p>\n","protected":false},"author":12,"comment_status":"closed","ping_status":"open","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[],"ht-kb-tag":[],"class_list":["post-10683","ht_kb","type-ht_kb","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb\/10683","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10683"}],"version-history":[{"count":18,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb\/10683\/revisions"}],"predecessor-version":[{"id":12374,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=\/wp\/v2\/ht-kb\/10683\/revisions\/12374"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10683"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fht-kb-category&post=10683"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fht-kb-tag&post=10683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}