Symptom
Is it possible to automatically generate foundation object codes?
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 HXM Suite
Cause
After Basic scenario deprecation for Business Rules, it was possible to set FO Codes with rules due no guardrails within deprecated scenario. From 2H2024 Release on, specific rule scenarios does not allow FO Code setting because it should not be changed through rules as they are part of business keys.
You can only apply it to custom MDF objects right now.
The below example is an example for Location.
Resolution
If you want system to generate foundation object codes, you have to define a sequence and then use this sequence in a business rule.
You can create a sequence in Manage Data as following. Please ensure the sequence does not begin at 0 or with a negative value:
Now you can create a business rule with corresponding Foundation Object as the base object as the following:
According to the above business rule, all position codes will be in the format: LOC_seqCurrentNumber.The format can be adapted as per business requirement.
This rule should be added as an onInit Rules in the Corporate Data Model.
The trigger of the rule, needs to be set on the foundation object element, after the labels, before the field configuration as seen below:
NOTE: Setting a Foundation object's external code and start date is not supported when the business rule is created using Rule scenario Foundation Objects -> Save Changes to Foundation Objects as these are business keys and should not be changed. Changing these values can cause data inconsistencies in the system. Hence this restriction is added in the rule scenario.
See Also
KBAs:
- 2352610 - Automatic generation of position code
- 2421728 - How to Autogenerate Employee ID/ Person ID Based on Country Using a Sequence
- 2418814 - How to configure an MDF Sequence object and Business Rule to auto-generate Person ID during Hire
Guide: Example: Automatic Generation of Legacy Foundation Object Codes
Keywords
Foundation object, Location, code, external code, generate, autogenerate, populate, sequence, business rule, employee central, employee profile, successfactors, SF, EC, EP, start-date, start date, Save Changes to Foundation Objects, INC8315527 , KBA , LOD-SF-EC-FOO , Foundation Objects (Organisation, Pay and Job Structures) , How To