Change “The form could not be submitted..” message in Dynamics 365 Portal

In my earlier article, we discussed how to implement custom javascript validation message, now let’s say we want to change the title of the validator.
validator4

So first thing I tried to check it’s element using inspect.
validator5
And used following code

$('#ValidationSummaryEntityFormControl_EntityFormView').attr("aria-label","Preffered appointment cannot be submitted due to the reasons below:");

But even though this label was changed, but validator title was same
validator6

Then I tried following code, in console

$('h4.validation-header').text("Appointment preferences cannot be submitted due to the reasons below:");

And I was able to see changes
validator7

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

 //change form validation labal
            setInterval(function () {
                if ($('h4.validation-header')) {
                    $('h4.validation-header').text("Appointment preferences cannot be submitted due to the reasons below:");
                }
            }, 1000);

Hope it will help someone, feel free to share if you know more efficient method to implement it.

3 thoughts on “Change “The form could not be submitted..” message in Dynamics 365 Portal

  1. Pingback: Change “The form could not be submitted..” message in Dynamics 365 Portal - Microsoft Dynamics CRM Community

Leave a Reply

Your email address will not be published. Required fields are marked *