Validation on publish products

Hi,
I’m trying to add validation rules for publishing of products.

Im using a class derived from ValidationRuleBase

When I set the validation result like this:
var result = new ValidationResult();
result.AddError(string.Empty, “Cannot publish product due to publishing rules”);

It only shows the text “Valideringsfel” but I also want to whoe the reason “Cannot publish product due to publishing rules”.

How do I do that?

Litium version: 7.2.1-patch-1905161008

Try with this instead:
result.AddError("*", “Cannot publish product due to publishing rules”);

Then it will show what you add as a message in the top row.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.