While working on Dynamics 365 Portal, We all have observed an error message is displayed like below when an error occurred in Portal Add-on.
\”We\’re sorry, but something went wrong. Error ID #[]\”
\”An unknown failure has occurred. Error ID # []\”
But they\’re quite unclear, so users cannot take any action based on this message. GUID doesn\’t help.
If there\’s certain contact such as e-mail address of Portal admin, the error message should contain this information and suggest to contact to admin.
These type of errors usually comes when any CRM Plugins/Workflows throw the Server-Side error while processing the Portal requests.
Currently, Microsoft has not provided any direct way to customize this error message. Though a lot of people submitted their ideas on Microsoft Idea Portal to addon this feature in upcoming portal releases.
https://ideas.dynamics.com/ideas/dynamics-crm/ID0000538
Solution:
$(window).load(function()
{
// You just need to Change the error message only
var errorMessage = \”We\’re experiencing an internal server problem. Please try again later or contact support@help.com\”;
$(\’.text-danger\’).html(\’ \’+errorMessage);
});
In the above code, you just need to change the error message and paste the whole code inside Custom JavaScript section of the Web page.
Hi Arpit, this is a great post. But for some reason, I'm not able to make it work. I'm trying to display a custom error on triggering a WF (when the WF is cancelled). Any help reg this is much appreciated!!!Thanks,Dhivya
LikeLike