Skip to Content
Product Information
Author's profile photo Dharmin Thakkar

Defaulting data from Standard Entities like Job Info, Comp Info etc to Custom MDF Object

Hello All,

I have seen a lot of requirement where the customer wants to default the standard entities value (Job Information, Compensation information etc.) to Custom MDF object. Below is the configuration to achieve this requirement.

Requirement:

Default the value of Job title, Standard Weekly Hours from Job Information, Hire Date from Employment Details,  Is Eligible for Benefits from Compensation information and First Name from Personal Information to MDF object named cust_test_mdf.

Create a Custom MDF object and change the Data Type of ‘externalCode’ field as ‘User. Five custom fields have been created. (cust_MDFJobTitle, cust_MDFHireDate, cust_MDFStandardWeeklyHours, cust_IsEligibleforBen, cust_firstname). Make all the fields as Read Only field.

Configure a screen for this object. Navigate to Manage Configuration UI > Select Base object as MDF object you created (cust_test_MDF) > Input the ID and Save it.

Navigate to Configure People Profile > Search for ‘Live Profile MDF Information’ > Drag and Drop the block and Select the screen created in the above step.

 

Configure a business rule. Navigate to ‘Configure Business Rule’ > MetaData FrameWork > Click on Rules for MDF Based Objects. Input the Rule Name, Rule Id, Base Object (MDF object – cust_test_mdf), purpose as ‘Evaluate’

‘IF’ condition is always True. ‘THEN’ Condition will have fields from MDF to be equal to the field from the standard entity. Kindly note – the navigation of standard entity in the rule will be MDFobject.externalCode.StandardEntity.Field (as highlighted in Green).

The rule is attached as ‘onChange’ in Object Definition > cust_test_mdf > effectiveStartDate > Details > Attach the Rule.

To Test the rule and configuration, check users information. Below is the user’s information from my demo instance.

Job Title – HE Business Partner Saudi Arabia.

Standard Weekly Hours – 40

Hire date – Jan 01, 2013

Is Eligible for Benefit – No

First Name – Omar

 

Navigate to the screen which you created in People Profile and click on the Edit button (Pencil Icon)

Once you click on Edit icon, automatically the page the will load and the data from various portlets will be populated.

You can also test the same by Navigating to Manage data > New > Object Name (cust_test_mdf) > Select the user in external code field > Select the date. The fields will automatically get populated.

 

Regards,

Dharmin Thakkar

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo baladeba behera
      baladeba behera

      Thanks for sharing Dharmin.

      Author's profile photo Prasanna Balu
      Prasanna Balu

      Thanks Dharmin.

       

      Have you done similar one for child composite object ? Three years back I had posted in EC Enablement jam forum.

      Question

      Hi,

      I'm looking for guidance to understand what should be done to Default value in Composite Child Instance field. The MDF implementation guide mentions the below

      Initialize rules are supported for composite child entities for both UI interaction and import. The fields of composite child objects are initialized with default values.
      You must execute the Initialize rules for composite child entities when they are initialized. This means that you must do the following:

      1.Execute the Initialize rules for a fake composite child instance in the CompositeAssocDefVo and pass the default values to the DataGridVO.

      Question is:
      How to initialize rule for a fake composite child instance in CompositeAssocDefVo and pass the default values to the DataGridVO ?

      Answer from Luke Marson:

      See the answer found in https://jam4.sapjam.com/groups/19gxOaHniue9xcOjeggAjo/documents/IPmd5hTH4HdTURX6nOzi3b:

      "One can configure an Initialize Rule for composite child entity like Initialize Rule for the Payment Info Details composite object.
      Basically create a rule with the concerned object as base object and attach the rule to initialize rule for the concerned object
      Pls ignore the comment on CompositeAssocDefVo and DataGridVO mentioned on page 60 of the MDF handbook at https://websmp104.sap-ag.de/~sapidb/011000358700000319392014E
      This is not relevant as of current and needs to be updated soon from knowledge management side .
      For an example on how to configure an Initialize Rule for composite child entity pls refer to attached document at
      https://jam4.sapjam.com/groups/19gxOaHniue9xcOjeggAjo/documents/GuUPzHQ6VjCsY4h4lwznUI/slide_viewer
      Example on Initialize Rule for composite child entity
      Steps :

      1. Go to Configure Object Definition -> Create 2 objects (MDFPerson with effectiveDate = BASIC and MDFAddress = FROM PARENT)
      2. For MDFAddress GO -> set the label for externalName = City -> Save
      3. Associate MDFAddress to MDFPerson as Composite 1:M -> Save
      4. Go to Configure Business Rule -> Create a Rule with Base Object = MDFAddress . Rule : If (Always true) Then SET city = Bangalore
      5. Go to Configure Object Definition Page -> Open the Child Object (MDFAddress) -> Attach the Rule to Initialize Rule
      6. Go to Manage Data -> Create new MDFPerson
      7. Expected Behavior > User should see the city field of child object,MDFAddress initialized with the value ‘Bangalore’
      "

      Author's profile photo Karthika Guduru
      Karthika Guduru

      Useful solution document

      Author's profile photo Former Member
      Former Member

      Thank you Dharmin.

       

      I understand from this description that to get the information updated in the custom MDF portlet, it has to be edited, right?

      Is there a way to force the update in the custom MDF portlet immediatly when the information is changed on the standard entities?

      In your example, if the job title is changed in job information, at save, is that possible to immediatly update the equivalent field in the custom MDF portlet.

      Thank you,
      Marion

      Author's profile photo Eugene Fourie
      Eugene Fourie

      Hi Marion - have you ever found a way to achieve this?

      Author's profile photo Antonio Ferreira Vicente
      Antonio Ferreira Vicente

      Thanks for the blog!!

      Author's profile photo NARENDER SINGH
      NARENDER SINGH

      Thank you, Dharmin,
      Is there a way to stop adding the information to custom mdf object if job information doesn’t exist. For ex: in standard MDF based payment info object, system gives an error the moment we try to add data to payment info if job info is missing.