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 #[<GUID>]"
"An unknown failure has occurred. Error ID # [<GUID>]"
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.
https://ideas.dynamics.com/ideas/dynamics-crm/ID0000538
Solution:
Though we do not have any direct way to achieve this, so I have written 2-3 lines of script. Using that you can show the user-friendly error message to the portal users.
$(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('<span class="fa fa-exclamation-triangle" aria-hidden="true"></span> '+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!!!
ReplyDeleteThanks,
Dhivya