In Umbraco V7 how to show custom error validation message on back office save or publish to user
I have tried following but it shows 'Publishing was cancelled by a 3rd party plugin' not actual error message
void ContentService_Saving(IContentService sender, SaveEventArgs<IContent> e)
{
e.Cancel = true;
ShowErrorBubble("Error saving item", "Error:duplicate records exists");
}
private static void ShowErrorBubble(string title, string exception)
{
try
{
umbraco.BasePages.UmbracoEnsuredPage.Current.ClientTools.ShowSpeechBubble(umbraco.BasePages.UmbracoEnsuredPage.speechBubbleIcon.error, title, exception);
}
catch (Exception ex)
{
//do nothing at the moment, forums suggest we cannot send an error message
}
}