SAP Knowledge Base Article - Public

2711979 - Business Rule Function Matches() not working in text box fields

Symptom

The business rule has been configured to validate special characters, but an error message is not being triggered when validating a text box field with multiple lines of text. 

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 SuccessFactors Employee Central
  • SAP SuccessFactors Metadata Framework

Reproducing the Issue

  1. Access the object or the employee where you have this field.
  2. Add a text in the first line.
  3. Add another text in the second line with the special character that should trigger the rule.
  4. See that the error message was not triggered. 

KB3.jpg

KB4.jpg

Resolution

For a text box field the regular expression consider only the first text line but to consider all the text add "(?)" in your regular expression.

Please see the comparation below:

  1. For a single text like the regular expression will be:  .*[!,@,#,$,%,^,&,*,(,),_,+,=,{,},",?,\,;,:,<,>].* (for more details on this, please refer to KBA 2691521);
  2. For a text box, add the expression (?) like in regular expression: (?s).*[!,@,#,$,%,^,|,&,*,(,),_,+,=,{,},",?,\,;,:,<,>].*

Please refer below to an image of how the rule should be configured:

KB1.jpg

See Also

2691521 - How to Create a Rule to Raise an Error Message When Special Characters are Entered in a Field

Keywords

XAF-26678, business rule, error message, special characters, validation, text box field, One line, multiple line, text line, considered, rule not working error, No validaton, No error message, multiple line of text , KBA , LOD-SF-EC-JOB-RUL , Job Info Business Rules , LOD-SF-EC , Employee Central , LOD-SF-MDF-RUL , Custom Oject based Business Rules , How To

Product

SAP SuccessFactors Employee Central 2505