- Cannot edit external Code field during the insert/upsert operation.
- Unable to edit data for the external code field in the MDF object while creating a new effective dated record.
- SuccessFactors Cloud HCM: MDF
- SuccessFactors Cloud HCM: EC MDF Object
Reproducing the Issue
- Create a user-based Effective Dated MDF Object
2. Create another MDF object and assign it as a child with Composite Association to the previously created object
3. In the child MDF object, use the standard field: externalCode to store data of type String. Add the other fields of your choice for storing the data
- Create data for a user on the above MDF object with a effective start date via the Manage Data section
- Add data for all the required fields
- Click on Save
- Go to Manage Data and choose the already existing instance of this object for a user
- Insert a new record for this object by choosing a different Effective Date
- Try editing the data in the existing fields where one of the fields being edited is externalCode field and click on Save.
- You will get an error as highlighted in the below screenshot (screenshot 1)
- Go to Employee Files and access the MDF Object Portlet that is available for any sample user
- Click on Edit and choose a different effective date.
- Try editing the data in the existing fields and click on Save.
- You will get an error as highlighted in the below screenshot (screenshot 2)
(In the second scenario described above, choosing a different effective date during the Edit operation means the system expects that there is already a record available for the chosen date. Hence when the system fails to find any record for the selected date, it understands that you are inserting a new record and hence the corresponding error)
The above error occurs since the child MDF Object is using the externalCode field as any other standard or custom field that can be used to save the different data in the MDF Objects. Since the externalCode field plays the role of a Primary Key field for an MDF Object, changing its data each time while adding a new record for different effective date results in error. This is because, each time when the instance of an MDF Object is modified or added, the system will update the changes for the corresponding MDF Object's instance by searching for the relevant primary key value to update that entry on the data table. Therefore, editing externalCode field's data each time when new records for different effective dates are added, the system will not be successful in matching the primary key on the data table which is required to identify and update the corresponding instance of that MDF Object.
externalCode field should be used only to store values that will not change each time a new effective dated record is added. For example: for a user-based MDF object this field acts as a primary key field with datatype as User, which will not be allowed to change during the insert operation. In the same way, for a non-user based MDF Object, it is recommended not to use this field to store any data that is expected to be changed each time a new record for different effective dates are added.
- MDF: Metadata Framework