5

Is there a simple way of stopping user from saving and publishing when a field is empty?

8

1) Publishing

To stop publishing when field is empty, there is no OOTB functionality. One option how you can achieve it with minimal effort is to put item (template) under workflow and use below approach to disable saving item when field is empty.

This will force content editors to fill in field values before saving and proceeding to next step of workflow. Afterwards they need to finish workflow and publish. Publish can be then manually or automatically when workflow is pushed to last step.

Without filling field, publishing won't be also possible.

2) Saving

You need to apply validation rules and especially FatalError to prevent saving of item when field is empty.

To achieve this you need to:

  1. Create similar validation rule as "Required" validation rule which is OOTB to achieve checking whether field is empty. By similar I meant exact copy (:-)) of '/sitecore/system/Settings/Validation Rules/Field Rules/Required' item
  2. Configure validation rule as FatalError - this will halt saving of item when validation fails - Set Result=FatalError as value of Parameters field in your validation rule

enter image description here

  1. Assign validation rule for your item template - to be sure item is not saved in every scenario, you need to select the Validation Rules` section in item template and select the rules to apply in the fields “Quick Action Bar", “Validate Button”, “Validator Bar” and the “Workflow”.

enter image description here


More information

Validation rules:

FatalError validation:

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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