The first parameter in the AddError
method specifies where the error should be displayed, you pass the field id if you want it shown next to the field or you pass *
if you want it shown at the top.
There’s an example here: https://github.com/LitiumAB/Education/blob/master/Developer%20Education/Tasks/Validation/Resources/ValidateBookAuthor.cs
if (!isAuthorTemplate)
{
// Pass ID of a field as first parameter to display the error next to that field in backoffice-UI
result.AddError("AuthorField", "Only Author-pages can be selected as author");
// ...and/or pass "*" to display the validation error in the header.
result.AddError("*", "Author page validation failed");
}