SAP Knowledge Base Article - Public

3598803 - Cannot set default values in custom MDF portlet and the Rule Trace log shows the externalCode fetches a null value

Symptom

  • When attempting to set initial values for an object in the MDF portlet in My Employee File, a business rule is configured with an initialization purpose by putting it to the Initialize Rules in the MDF object definition. Upon opening the portlet in My Employee File and checking the Rule Trace log, the externalCode fetches a null value. 
  • When opening the portlet with a initialize rule in My Employee File to check the Rule Trace log, the externalcode fetches null value. Log Action: Retrieve; Content: “Retrieved 'externalCode'. Value: 'null'.

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 Core

Reproducing the Issue

  1. Configure a business rule, setting the purpose as initialize.
  2. Go to Configure Object Definition, assign the rule as the Initialized Rules.
  3. Expect the rule should set as the default value to the custom MDF portlet in Employee Profile
  4. Notice that the portlet reflects no changes, indicating the rule didn't execute
  5. Activate Rule trace log, and it shows that the externalCode value was null when read from the business rule

Cause

The Initialized Rules fetch data from the database, but as the MDF object has null values, the rule fails to execute as intended. This is because the MDF object definition does not inherently store data; it relies on database entries. 

Resolution

To set the initial value for the MDF object, admins can set the business rule at the field level because an onChange rule is triggered when a field's value is modified and it sets default values by locally stored data. 

Please follow steps below:

  1. Go to Configure Object Definition
  2. Select Make Correction
  3. Remove the business rule in the Rule > Initialize Rules
  4. Set the business rule as an OnChange Rule on the field, such as 'effectiveStartDate'

Note: The purpose of onChange rule should be set to evaluate, not initialize; otherwise, the business rule cannot be searched when attempting to configure it in the fields. 

See Also

Providing Default Values | SAP Help Portal

Keywords

MDF Object, Business Rules, Initialize Rules, MDF Object Definition, externalCode, onChange Rule , KBA , LOD-SF-MDF-RUL , Custom Oject based Business Rules , Problem

Product

SAP SuccessFactors HCM Core all versions ; SAP SuccessFactors HCM Suite all versions