Saturday 29 September 2018

Validate an item


The Sitecore field validators are a set of user-input validators that can be applied to an item, a specific field type, or a specific field on an item.

The Content Editor validates the fields automatically. If there are fields that contain validation errors or warnings, a red bar appears to the left of the relevant field and in the validator bar, the icons change to red or yellow depending on the type of error. To see the details of the errors, move your mouse over the individual icons in the validator bar.

  1. Navigate to /sitecore/system/Settings/Validation Rules/Field Rules and create folder and Right Click on Folder select  copying, select copyTo than open new Popup and select /sitecore/system/Settings/Validation Rules/Field Rules/Sample/Max Length 40. For Example : Validate MaxLenght 5 on field.



  2. Rename the item and fields of validation like this.


  3. Navigate to the Template and select which filed are you apply the validation rule. 
  4. Go to the validation Rule sections and inherit validation rule which you apply. For Example max length 5.


  5. There are four types of validation in Sitecore :


    a. Quick Action Bar
    b. ValidationButton
    c.Validation Bar 
    d WorkFlow
  6. Create an Item base on Template and fill data and show Error Message.




  7. In the Experience Editor, you can set up Sitecore to run the validation check on your pages every time you click Save:
    • In the Experience Editor ribbon, on the View tab, in the Enable group, click Field validation.
    • In this way, when you make changes to a page and click Save, the validation check runs through all the fields on the page. If there are fields that contain validation warnings or errors, the fields are highlighted with a color-coded dotted line according to the warning or error type and a notification appears with more details.
  8. In the Content Editor and the Experience Editor, you can run the validation test manually and view the details about the validation test in the Validation Result dialog box.
    To run a validation test manually on an item:
    1. In the Content Editor or the Experience Editor, navigate to the relevant item or page.
    2. To run the validation test on your item or page:
      • In the Content Editor, on the Review tab, in the Proofing group, click Validate.
      • In the Experience Editor, on the Home tab, in the Proofing group, click Validate.
    In the Validation Result dialog box, you can see an overview of the results of the validation and suggestions for change. The possible values are:
    • 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.


No comments:

Post a Comment

Sitecore Publishing Service 7.0 Installation Guide

  About the Publishing Service module The Publishing Service module is an optional replacement for the existing Sitecore publishing methods....