{"id":3311,"date":"2018-09-13T23:12:34","date_gmt":"2018-09-13T23:12:34","guid":{"rendered":"http:\/\/himbap.com\/blog\/?p=3311"},"modified":"2018-09-13T23:12:34","modified_gmt":"2018-09-13T23:12:34","slug":"change-the-form-could-not-be-submitted-message-in-dynamics-365-portal","status":"publish","type":"post","link":"https:\/\/himbap.com\/blog\/?p=3311","title":{"rendered":"Change &#8220;The form could not be submitted..&#8221; message in Dynamics 365 Portal"},"content":{"rendered":"<p>In my earlier article, we discussed how to <a href=\"https:\/\/himbap.com\/blog\/?p=3304\">implement custom javascript validation message<\/a>, now let&#8217;s say we want to change the title of the validator.<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator4.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3314 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator4-300x51.png\" alt=\"validator4\" width=\"300\" height=\"51\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator4-300x51.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator4-624x106.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator4.png 948w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>So first thing I tried to check it&#8217;s element using inspect.<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator5.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3315 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator5-300x80.png\" alt=\"validator5\" width=\"300\" height=\"80\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator5-300x80.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator5-624x167.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator5.png 664w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nAnd used following code<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n$('#ValidationSummaryEntityFormControl_EntityFormView').attr(&quot;aria-label&quot;,&quot;Preffered appointment cannot be submitted due to the reasons below:&quot;);\r\n<\/pre>\n<p>But even though this label was changed, but validator title was same<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator6.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3316 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator6-300x39.png\" alt=\"validator6\" width=\"300\" height=\"39\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator6-300x39.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator6-1024x133.png 1024w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator6-624x81.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator6.png 1315w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Then I tried following code, in console<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n$('h4.validation-header').text(&quot;Appointment preferences cannot be submitted due to the reasons below:&quot;);\r\n<\/pre>\n<p>And I was able to see changes<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator7.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3317 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator7-300x24.png\" alt=\"validator7\" width=\"300\" height=\"24\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator7-300x24.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator7-1024x82.png 1024w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator7-624x50.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/09\/validator7.png 1469w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>But when I used this code under entity form and checked, it was still showing old title. Finally I found above heading element is generated at run time only, so finally I was able to do using setinterval method like following<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n \/\/change form validation labal\r\n            setInterval(function () {\r\n                if ($('h4.validation-header')) {\r\n                    $('h4.validation-header').text(&quot;Appointment preferences cannot be submitted due to the reasons below:&quot;);\r\n                }\r\n            }, 1000);\r\n<\/pre>\n<p>Hope it will help someone, feel free to share if you know more efficient method to implement it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my earlier article, we discussed how to implement custom javascript validation message, now let&#8217;s say we want to change the title of the validator. So first thing I tried to check it&#8217;s element using inspect. And used following code But even though this label was changed, but validator title was same Then I tried following code, in console And&#8230; <a href=\"https:\/\/himbap.com\/blog\/?p=3311\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3206,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[21,402,508],"tags":[628,404,629,581],"_links":{"self":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3311"}],"collection":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3311"}],"version-history":[{"count":4,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3311\/revisions"}],"predecessor-version":[{"id":3320,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3311\/revisions\/3320"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/3206"}],"wp:attachment":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}