{"id":1520,"date":"2008-09-22T03:45:11","date_gmt":"2008-09-22T08:45:11","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/docs\/?page_id=1520"},"modified":"2021-09-27T11:24:34","modified_gmt":"2021-09-27T16:24:34","slug":"how-to-customize-error-messages-in-your-web-applications","status":"publish","type":"ht_kb","link":"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/how-to-customize-error-messages-in-your-web-applications","title":{"rendered":"Customize Error Messages in your Web Applications"},"content":{"rendered":"<p><!-- Begin Content --><\/p>\n<h1>Customize Error Messages in your Web Applications<\/h1>\n<p>Many developers want flexibility.  Appropriately, they deserve it!  One way to get flexibility within your m-Power applications is to customize your error messages.  While m-Power generates generic terms such as &#8220;Invalid User&#8221; or &#8220;This record already exists&#8221; automatically, you can override these messages to something much more appropriate for your web application.  For instance, if you are creating a Shopping Cart, you would most likely prefer a message that encourages users to add items to an empty shopping cart in lieu of a &#8220;This record does not exist&#8221; message.<\/p>\n<p>There are two ways to add customized error messages: on an application level or for the entire Data Dictionary.  Simply stated, you should choose the &#8220;per application&#8221; option if your error message only corresponds to a few applications.  For convenience&#8217;s sake, both methods will be explained:<\/p>\n<h3>Per Application Method<\/h3>\n<p>If you decide that your Custom Error Message would only apply to a few applications (rather than every application in your Data Dictionary), you should choose this method.  Build and compile your application as you normally would.  Next, click the &#8220;Edit Properties&#8221; button for your application.<\/p>\n<p>In the App Property window, click the &#8220;Override Global Properties&#8221; tab:<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/docs\/vue-images\/customerrors1.jpg\"><\/p>\n<p>From the &#8220;Override Other Properties&#8221; drop-down, select the Default Error Message you wish to customize (in this example, we will customize the &#8220;Record Does Not Exist&#8221; message). Click the &#8220;Add&#8221; button:<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/docs\/vue-images\/customerrors2.jpg\"><\/p>\n<p>Modify the &#8220;Value&#8221; section to whatever you would like your message to say at Runtime in place of the default message.  Here we will program it to say: &#8220;Sorry &#8212; your search is invalid, please try again.&#8221;<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/docs\/vue-images\/customerrors3.jpg\"><\/p>\n<p>Click &#8220;Save Application Properties&#8221; to save.<\/p>\n<p>When I re-run my application, here is my output when the default &#8220;Record does not Exist&#8221; message should appear:<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/docs\/vue-images\/customerrors4.jpg\"><\/p>\n<h3>Per Data Dictionary Method<\/h3>\n<p>If you decide that your custom error messages could apply to all applications within your Data Dictionary, choose this method.<\/p>\n<p>Open the Admin Slider &#8211;&gt; Dictionary Configuration &#8211;&gt; Runtime Application Settings.<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/docs\/vue-images\/customerrors5.jpg\"><\/p>\n<p>Click the &#8220;Others&#8221; tab to customize messages.<\/p>\n<p><strong>Note:<\/strong> You can also change default images from this tab (such as back &amp; next buttons for Multiple Row Data List and Data List with Web Form Templates).<\/p>\n<p><strong>Note:<\/strong> You can also change Maintainer Messages by clicking the &#8220;Maintainer Message&#8221; tab.<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/docs\/vue-images\/customerrors7.jpg\"><\/p>\n<p>Change the &#8220;Value&#8221; for the appropriate Error Message name.  When completed, click the &#8220;Save Runtime Properties&#8221; button.<\/p>\n<p><strong>Note:<\/strong> When necessary, changes made at the Application Level supersede changes made at the Data Dictionary Level.<\/p>\n<p><!-- End Content --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Customize Error Messages in your Web Applications Many developers want flexibility. Appropriately, they deserve it! One way to get flexibility within your m-Power applications is to customize your error messages. While m-Power generates generic terms such as &#8220;Invalid User&#8221; or &#8220;This record already exists&#8221; automatically, you can override these messages&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[255],"ht-kb-tag":[],"class_list":["post-1520","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-mpainter"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/1520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/comments?post=1520"}],"version-history":[{"count":12,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/1520\/revisions"}],"predecessor-version":[{"id":9967,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/1520\/revisions\/9967"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/media?parent=1520"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=1520"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=1520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}