Monday, September 9, 2019

How to add the Field validation rules in sitecore and make it fatal Error


In Sitecore Validation will avoid man made mistakes.
you can control output entering into the field and make particular field is required.
We have Various validation types like Item,Field,Field Types,Global.you can find the validation rules on the path :/sitecore/system/Settings/Validation Rules

so we are talking about the field validation over here:
on the field validation there are 4 types of validations based on the message you are displaying.

Quick action bar-- Runs in the bar to the left of the content tree
Validation Button: whenever you click on the Validation Button, you will see the message on the validation Rules.Navigation path:Select the ItemàReviewàValidationàValidation Rules
Validator Bar: There is a red solid line will display at the field
Workflow: this is for the workflow

Whatever the field on a template you want to make required go to that field in sitecore and expand the validation Rules àQuick Action Bar à add Required,do for all if you want to see error messages on all 4 places.
If you wanna make error level more critical without satisfying the field they can’t save the item.the highest level is FatalError Result=FatalError.

these are the error levels in sitecore, you can find more on sitecore documentation

  • Valid (green) – no action is needed.
  • Suggestion (yellow) – look into the issue and decide if an action is needed.
  • Warning (orange) – act on the issue.
  • Error (red) – this is an error.
  • CriticalError (red) – the warning appears before you save the changes.
  • FatalError (red) – you cannot save the item before the error is corrected.

after you implemented the above steps the fatal error looks like below.whenever you are trying to save the item


No comments:

Post a Comment