{"id":1520,"date":"2008-09-22T03:45:11","date_gmt":"2008-09-22T08:45:11","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/legacy\/?page_id=1520"},"modified":"2017-08-18T10:59:45","modified_gmt":"2017-08-18T15:59:45","slug":"how-to-customize-error-messages-in-your-web-applications","status":"publish","type":"page","link":"https:\/\/www.mrc-productivity.com\/legacy\/m-painter-app-prop\/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>&nbsp;<\/p>\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 &quot;Invalid User&quot; or &quot;This record already exists&quot; 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 &quot;This record does not exist&quot; 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 &quot;per application&quot; option if your error message only corresponds to a few applications.  For convenience&#39;s sake, both methods will be explained:<\/p>\n<p><strong>Per Application Method<\/strong><\/p>\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 &quot;Application Properties&quot; button for your application.<\/p>\n<p>In the m-Painter window, click the &quot;Override Properties&quot; tab:<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/legacy\/images\/customerrors1.jpg\" \/><\/p>\n<p>From the &quot;Override error message&quot; drop-down, select the Default Error Message you wish to customize (in this example, we will customize the &quot;This Record Does Not Exist&quot; message).  Click the &quot;Add&quot; button:<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/legacy\/images\/customerrors2.jpg\" \/><\/p>\n<p>Modify the &quot;Value&quot; 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: &quot;No such record &#8212; please retry your search.&quot;<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/legacy\/images\/customerrors3.jpg\" \/><\/p>\n<p>Click &quot;OK&quot; to save.<\/p>\n<p>When I re-run my application, here is my output when the default &quot;Record does not Exist&quot; message should appear:<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/legacy\/images\/customerrors4.jpg\" \/><\/p>\n<p><strong>Per Data Dictionary Method<\/strong><\/p>\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>Click the Admin tab, then click the &quot;Edit Data Dictionary Files&quot; link.<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/legacy\/images\/customerrors5.jpg\" \/><\/p>\n<p>Click the &quot;Servlet Properties&quot; link.<\/p>\n<p>Click the &quot;Others&quot; 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 Record\/Work-With Templates).<\/p>\n<p><strong>Note:<\/strong> You can also change Maintainer Messages by clicking the &quot;Maintainer Message&quot; tab.<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/legacy\/images\/customerrors7.jpg\" \/><\/p>\n<p>Change the &quot;Value&quot; for the appropriate Error Message name.  When completed, hit the &quot;OK&quot; button.  Finally, click the &quot;Save and Deploy&quot; icon.<\/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 &nbsp; 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 &quot;Invalid User&quot; or &quot;This record already exists&quot; automatically, you can override these messages to something much more [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1410,"menu_order":17,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1520","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/comments?post=1520"}],"version-history":[{"count":12,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1520\/revisions"}],"predecessor-version":[{"id":8619,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1520\/revisions\/8619"}],"up":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1410"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/media?parent=1520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}