SAP Knowledge Base Article - Public

2510329 - UI Rule to set field as required is not working

Symptom

  • For an MDF UI, created in Manage Configuration UI, we have created a simple UI rule.
  • This rule is created to set a field on the UI to be required/non-mandatory based on some If conditions.
  • The rule is not triggering and the field never becomes required/non-mandatory

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

Metadata Framework - Manage Configuration UI

Cause

This is a known issue.

Resolution

  • Issue is fixed through PATCH in b1908p11 deployed on 25-Oct-2019
  • Issue is fixed in 1911 version

You can also use following workarounds.

Workaround 1:

If you trigger the rule on Change of each field referenced in the IF conditions of the UI, the rule will work on save of the portlet. 
You will receive an error that the field is required.

Workaround 2:

The below example was created for a Payment Information UI, but can be adapted for use with any MDF object.

We can implement an on save, raise message business rule, triggered from the object.
This will raise an error message, preventing the user from saving, if the required field is null.

  1. Create a Message Definition,with an appropriate error text.
  2. Create a business rule, with the Object you are using as the base object.
    The below example will raise an error message is the required field is null and the Bank Country if France:
    9.png
  3. The rule is triggered onSave on the corresponding object Definition:
    11.png

For further information on creating a raise message business rule, please see the following KBA:
2092849 - How to create a Business Rule to validate data on change/save, and provide a Warning or Error message

Keywords

UI-6475, UI Rule, UI Rule, required, manage configuration UI, payment information, , KBA , LOD-SF-MDF-UI , UI Config, Layout & Rules , LOD-SF-EC-MDF , MDF & EC2MDF Migration , Problem

Product

SAP SuccessFactors HXM Core all versions