I have applied some validation rules in template standard value as below.
When I am trying to create data item based on this template, rules are not kicking in and data is saved with empty Title
field.
Is there anything that I am missing?
I have applied some validation rules in template standard value as below.
When I am trying to create data item based on this template, rules are not kicking in and data is saved with empty Title
field.
Is there anything that I am missing?
First thing, you have selected your rules in the Quick action bar, which means Validation issues appear in the Quick Action Bar on the left in Content Editor. To see the error while saving the item, you'll need to select the rule in Validation Bar for the field:
Then, you will need to pass the Fatal Result parameter in the rule item (/sitecore/system/Settings/Validation Rules/Field Rules/Required
)
The Result parameter determines the default result value of validation. Possible values are:
Now, after doing this, if you save an item without entering a value in field, you will get this pop up:
Validation options are available in the validation rules section of the data template's standard value and template field definitions. From your image and questions, it looks like you are using field-level validation not item-level validation. Sitecore has a set of default validation options in the validation rules section. These validations will not stop you to save the items by default but will show you errors in different sections. see below image for different section -
I guess you are adding validation in "Quick Action Bar" only, in this case, you will see the errors in the quick action bar only which you can enable by right-clicking in the left section in the content editor. -
If you have a requirement to not save the items with the validation, you need to update the parameter field of the validation rule, I would suggest you, create a custom validation rule and not update the existing OOTB rule for it. but the process will be as below -
Result=FatalError