SAP Knowledge Base Article - Public

2633538 - How to set a Custom Field on a Custom UI View as Mandatory

Symptom

You have a Custom Field in a Custom UI View and you would like to set this field as mandatory directly on UI Designer.

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

Environment

  • SAP Cloud for Customer
  • SAP Business ByDesign
  • SAP Cloud Application Studio

Resolution

There is a Field setting on UI Designer where we can set the property "Mandatory" of the field as "True", but this setting is only used for aesthetics. It will only add the read '*' on top of the field label, but no Runtime validation on client will be added.

mandatory-GDPR.png

To set a Custom Field of a Custom UI View as mandatory you can use one of the following ways:

1. Use .absl scripting events (Event-BeforeSave and Validation-OnSave) to check if any valid value was maintained on the field, raise error message and prevent save in case the value is empty or not valid.

OR

2. Use the Key User Tools (KUT) to change the properties of this field and set it as mandatory.

Keywords

Custom View, Custom Field, Field, Mandatory, KUT, Key User Tool, UI Designer, SDK, PDI , KBA , AP-RC-UIF-UX , UI Framework User Interface Design , AP-RC-BDS-UI , ByDesign Studio UI Generation , How To

Product

SAP Business ByDesign all versions ; SAP Cloud Applications Studio all versions ; SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions