Re: Inconsistent error Message location on screen
@PortalNewbie
As the alert item does not have an ID or reference you can use as selector, what I do is return a string as the custom error message (id_plugin_error), which I then use to select and move the item and present a predefined message.
var alertElement = $("p:contains('id_plugin_error')");
if (alertElement .length) {
$(alertElement ).parent("div").remove();
$("div.tab.clearfix").prepend('<div class="alert red" id="delete-failed" role="alert" tabindex="0"> <div class="cell"> <i class="fa fa-warning"></i> </div> <div class="cell"> <h4>Custom Header</h4> <p>Custom Error message</p></div> </div>');
}
This is what the error message markup will look like for the Advance form
<p class="text-danger"><span class="fa fa-exclamation-triangle" aria-hidden="true"></span> An unexpected error occurred from ISV code. (ErrorType = ClientError) Unexpected exception from plug-in (Execute): DummyPlugin.ThrowErrorPlugin: System.Exception: This is a dummy error </p>
As compared to the Basic Form which at least have an id of MessagePanel. This is a bit inconsistent and ideally should be fixed by Microsoft.
<div id="MessagePanel" class="message alert alert-info alert-danger alert-danger" role="alert">
<span id="MessageLabel" tabindex="0"><p class="text-danger"><span class="fa fa-exclamation-triangle" aria-hidden="true"></span> An unexpected error occurred from ISV code. (ErrorType = ClientError) Unexpected exception from plug-in (Execute): DummyPlugin.ThrowErrorPlugin: System.Exception: This is a dummy error</p></span>
</div>