SAP Knowledge Base Article - Public

3669907 - onInit rule does not auto-populate field in custom MDF object

Symptom

  • onInit rules configured for a custom MDF object does not auto-populate rules when creating new record.
  • The rule trace indicates that the rule fetches a null value for the field.
  • A similarly configured onSave rule populates the same fields.

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 HCM Suite
  • Metadata Framework

Reproducing the Issue

  1. Configure an onInit rule which should auto-populate certain fields on the MDF object
  2. Configure a UI for the object and place it on the People Profile
  3. Create a new record for the MDF, observe that the expected fields are not auto-populated by the rule

Cause

onInit rules are executed before the UI is loaded and that time the userID (external code) is blank. Consequently, the rule fetches a null value for the field.

Resolution

Modify the configuration to attach the rule as an 'onSave' or 'onChange'. This will ensure that the fields are auto-populated correctly after once the rule runs.

NOTE: make sure that the purpose of the rule is set to 'evaluate' and not to 'initialise'.

See Also

  • KBA 2562051 - Custom MDF - Business Rules FAQ 
  • KBA 2562069 - Scenario based business rules for MDF objects, Parameters, Limitations and other information about custom MDF Business Rule configuration scenario - SAP for Me
  • KBA 2324639 - How to populate object information from Employee Central to Custom Portlet or Objects via Business Rule? - SAP for Me

Keywords

auto-populate field, MDF object, initialization rule, People Profile, rule trace, null value, onLoad, onSave, custom MDF object, field not populating, rule configuration, external code blank, UI, populate, rule, object, , KBA , LOD-SF-MDF-RUL , Custom Oject based Business Rules , LOD-SF-MDF-UI , UI Config, Layout & Rules , LOD-SF-MDF-OBJ , Object Definition & Field Related Issues , LOD-SF-MDF-WFL , Custom Object based Workflows , Problem

Product

SAP SuccessFactors HCM Suite all versions

Attachments

Pasted image.png