Status Colors and Icons

Status Colors and Icons

You can define status colors and icons.

The UI annotations in CDS for LineItem, Identification and FieldGroup have an attribute in the corresponding fields that indicates how critical the field is using colors and icons. This attribute has to refer to another property, which contains the value of the criticality.

Sample Code

<Record Type="UI.DataField">
		<PropertyValue Property="Criticality" Path="to_ProductStock/StockCriticality"/>
		<PropertyValue Property="Value" Path="to_ProductStock/StockEmergencyLevel"/>
        <PropertyValue Property="CriticalityRepresentation" EnumMember="UI.CriticalityRepresentationType/WithIcon"/>
		<Annotation Term="UI.Importance" EnumMember="UI.ImportanceType/High"/>
</Record>

The property containing the criticality can have the following values (derived from the complex type CriticalityType of the vocabulary com.sap.vocabularies.UI.v1):

The texts are not static, you can change them to suit your purposes by defining them in the criticality path. The following shows examples of using these values in stock availability of products both in the list report and the object page: