6

I can publish an item with a blank field that have validation rule where required. How can I use workflow to prevent publish item with a blank field?

8

Yes, it is possible to do this without customization. Sitecore has the special validation rule that is named "Required", which checks fields that contain the value​​.

You can find it in Sitecore/System/Settings/Validation Rules/Field Rules.

Please, configure the workflow and validation rules for your template, in this way:

  1. In the "master" database open template, whose fields you want to check before publishing.

  2. Go to the template field item, - that must be validated

  3. In the section "Validation Rules", in the "Workflow" field, select the "Required" validation rule. Note: If you want that your users got the notifying that the field must contain a value when they edits item, set the "Required" rule to the other fields in this section.

  4. Then, go to "__Standard Values" item of your template and in "Workflow" section (in "Standard Fields") set the "Default Workflow" field to "Sample Workflow".

Please have a look on these links:

  1. http://sdn.sitecore.net/upload/sitecore6/64/client_configuration_cookbook_sc64-a4.pdf ( section 4.2 )

  2. https://sdn.sitecore.net/upload/sitecore6/64/workflow_reference-usletter_sc60-64.pdf

| improve this answer | |
0

For absolutely required validation rules, I sometimes set the "Parameters" field for the validation rule to include the "Result=FatalError" which then won't allow users to change an item until the field is filled in.

Other options for Result parameter include:

  • Suggestion
  • Warning
  • Error
  • Critical Error

Only the FatalError setting will force the user to resolve the validation rule before they are allowed to save. The others will display the appropriate message but will still allow users to save the item.

| improve this answer | |
0

Just assign the item with appropriate workflow and it will not be included in publishing. The default behavior of Sitecore is if the item is in workflow (draft or awaiting approval), it will exclude the item to get published.

Also if you have a validation rule applied and then also if you are able to save the item, check is there any JS error which is preventing the validation to get executed or not. Just a thought.

Hope this helps or let me know.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.