SAP Knowledge Base Article - Public

2535669 - How to Make Attachment Mandatory Using a Business Rule - Employee Central

Symptom

How to use a business rule to validate if an attachment has been added, and if not, raise an error message asking to do so.

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

Resolution

We can add the rule as follows:

IF <Element ID>.<attachment field id>  == NULL

then ELSE ***

Example [<Element ID>.<attachment field id>  like in jobInfo.attachment-id OR nationalIdCard.attachment-id]

Base object can be National ID Information or any other element that uses attachment, please see example below.

In this example we are validating that an attachment has been added if country/region is GB, or else it throws an error:

National_ID.png

 

The rule works fine, however, the rule trace on Employee Time Attachment will have values such as:

'The expression 'EmployeeTime.cust_attachment' could not be evaluated completely as the property 'cust_attachment' of 'EmployeeTime' is found to be NULL at 'EmployeeTime.cust_attachment'. Evaluation result is NULL.'

The attachment field does not store a value you can compare per say. It is storing a file!

Therefore there is no "value" you can compare with - hence why the Rule Trace will tell you - "The expression 'EmployeeTime.cust_attachment' could not be evaluated completely as the property 'cust_attachment' of 'EmployeeTime' is found to be NULL at 'EmployeeTime.cust_attachment'. Evaluation result is NULL."

All it is saying here is that it could not "completely" evaluate all the data returned when checking this field (as data such as personId, userId, attachment-id, timestamp, XYZ other info is returned) - but it correctly validated that the field is NULL and serves the purpose.

The above apply in all areas where adding attachment is possible

NOTE: You must use the option Null available to be selected in the business rule configuration and not a text as Null.

''

See Also

2538171 - National Id Portlet - Mandatory Attachment field not working as expected.

Keywords

could not be evaluated completely, if attachment is null, make attachment mandatory, Attachment required, rule , KBA , LOD-SF-EC-JOB-RUL , Job Info Business Rules , LOD-SF-EC , Employee Central , How To

Product

SAP SuccessFactors HXM Suite all versions