SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Implement Create Entity and Linking Entities in an MDK App

Create relationship between two OData entities.

Overview

🎓 intermediate 30 min. Mobile Development Kit ClientIntermediateIosAndroidMobileSAP Business Technology PlatformSAP Mobile ServicesSAP Build CodeSAP BuildSAP Business Application Studio

You will learn

  • โœ”How to create relationship between parent and child entities
  • โœ”How to create a child entity to an existing parent entity
  • โœ”How to create a parent entity first and then a child entity
  • โœ”How to implement dynamic data subscription
Jitendra Kansal J Jitendra Kansal June 14, 2026
Created by October 15, 2022
Contributors

Prerequisites

Steps

Intro

You may clone an existing metadata project from the MDK Tutorial GitHub repository to start with this tutorial.


For this tutorial, you will use Mobile Services sample backend (step 3) which has parent-child relationship setup among entities. For example, A customer can have n (>=0) number of sales orders.

To create an entity and then link it to another entity, you need to carry out the following tasks:

  • Create a new page for creating an order
  • Add an action bar item to the new page for cancelling the current activity
  • Create a new CreateRelatedEntity OData action to create a new sales order
  • Create a new message action for displaying failure message if order creation fails
  • Create a navigation action to show order creation page from Customer detail page
  • Implement data subscription to update count value when a new sales order is created

MDK
MDK

Step 1 Create new page for new Sales order record
โ€”

In this step, you will create a Section page with a Form Cell Section to contain the Form Cell controls. You will then add the fields that will be editable by the end-user.

  1. Right-click the Pages folder | MDK: New Page | Section | Next.

    MDK
    MDK

  2. In the Base Information step, enter the Page Name as SalesOrderHeaders_Create and click Finish to complete the page creation process.

    MDK
    MDK

  3. Once the page opens in the page editor, click on the white area to select it’s Action Bar, and set the Caption to Create Order.

    MDK
    MDK

  4. Now, you will add the fields (like Currency Code, Net Amount, Tax Amount, Gross Amount, Life cycle status, Life cycle status name and order creation date) for creating a new sales order record by the end-user. In the Layout Editor, expand the Static Container group. Drag and drop Form Cell section onto the Page area.

    MDK
    MDK

    Form Cell section is used to contain Form Cell controls in a section page.

  5. You will now add Form Cell controls in the Form Cell Section. Expand the Form Cell Controls group, drag and drop a Simple Property onto the Page area.

    MDK
    MDK

  6. Drag and drop five additional Simple Property controls and one Date Picker control onto the page so you have seven total controls.

    MDK
    MDK

  7. Select the first Simple Property control and provide the below information:

    PropertyValue
    NameFCCreateCurrencyCode
    CaptionCurrency Code
    ValueEUR

    MDK
    MDK

    Under Value property, you can set some default values.

  8. Select the second Simple Property control and provide the below information:

    PropertyValue
    NameFCCreateNetAmount
    CaptionNet Amount
    Value18.010

    MDK
    MDK

  9. Select the third Simple Property control and provide the below information:

    PropertyValue
    NameFCCreateTaxAmount
    CaptionTax Amount
    Value108.010

    MDK
    MDK

  10. Select the forth Simple Property control and provide the below information:

    PropertyValue
    NameFCCreateGrossAmount
    CaptionGross Amount
    Value126.02

    MDK
    MDK

  11. Select the fifth Simple Property control and provide the below information:

    PropertyValue
    NameFCCreateLifeCycleStatus
    CaptionLifecycle Status
    ValueN

    MDK
    MDK

  12. Select the sixth Simple Property control and provide the below information:

    PropertyValue
    NameFCCreateLifeCycleStatusName
    CaptionLifecycle Status Name
    ValueNew

    MDK
    MDK

  13. Select the last control Date Picker and provide the below information:

    PropertyValue
    NameFCCreatedate
    CaptionCreation Date
    ModeSelect Datetime from the dropdown if not selected by default

    MDK
    MDK

Step 2 Add cancel button on create Sales Order page
+
Step 3 Store the created data locally
+
Step 4 Navigate to the Customer Create page
+
Step 5 Add data subscription to Customer detail page
+
Step 6 Deploy the Project
+
Step 7 Run the Project
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 7
1. Create new page for new Sales order record 2. Add cancel button on create Sales Order page 3. Store the created data locally 4. Navigate to the Customer Create page 5. Add data subscription to Customer detail page 6. Deploy the Project 7. Run the Project

Learn more →