SAP Knowledge Base Article - Public

2913083 - Business Rule to Generate External Code for Child object is not working on Initial Record

Symptom

  • Customer created a Custom MDF object with association. They also created a rule to create external code for the Child object.
  • The creation of External code is not working on initial record. It works when you insert a new record or for succeeding records aside the initial record.

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 HXM Suite
  • Metadata framework (MDF)

Reproducing the Issue

  1. Create Custom MDF cust_ParentTest and cust_Child1 associated as composite with one is to many association.
  2. Create Business rule to create External code for cust_Child1.Example:
  3. Attached it to cust_Child1 as Saved Rules.
  4. Create a record for cust_ParentTest and add two or more records for cust_Child1 object.
    Example:
    Create two records for cust_Child1 object with externalName value of TESTA and TESTB
  5. Click on Save. Only the first record will show on the record with externalName as TESTA.

Cause

Business Rule does not work for multiple child record if added under Save Rules.

Resolution

  1. It is not recommended to create External code based on business rule as it is the primary key of the MDF record. If customer wants to automatically create External code, it is recommended to use Auto number as data type of External code.
  2. If customer already had some data on object and it is not possible to change the data type, then instead of adding the Business Rule as Save Rules, add it as a Field level Rule on any required field under the Child object

    Example:
    Go to cust_Child1 and look for field externalName (you can use other fields aside from externalName, but the field should be set as mandatory to ensure that it will be supplied with values during record creation, otherwise rule will not trigger) and add the rule as Field Level rule.

Keywords

Auto number external code, external code, business rule to generate external code, auto generate external code, create external code, , KBA , LOD-SF-MDF-RUL , Custom Oject based Business Rules , LOD-SF-MDF , Metadata Framework , Problem

Product

SAP SuccessFactors HCM suite all versions