Help Center/ Huawei Cloud Astro Zero/ Best Practices/ Objects/ Associating Customer Information with Order Data and Synchronizing the Modification
Updated on 2025-08-27 GMT+08:00

Associating Customer Information with Order Data and Synchronizing the Modification

Expected Results

In some order systems, customer information and order data need to be associated for order processing and inventory deduction. For example, order application A has two objects: customerList and orderList. You can establish an association between these two objects to implement the following functions:

  • Add and display customer object data.
    Figure 1 Adding customer object data
    Figure 2 Displaying customer object data
  • Add order data and associate it with the existing customer information.
    Figure 3 Adding order data and associating it with the existing customer information
  • After the customer data is deleted, the associated order data is also deleted.
    Figure 4 Deleting customer data
    Figure 5 Associated order data deleted

Procedure

  1. Create a low-code application.

    1. Apply for a free trial or purchase a commercial instance by referring to Authorization of Users for Huawei Cloud Astro Zero Usage and Instance Purchases.
    2. After the instance is purchased, click Access Homepage on Homepage. The application development page is displayed.
    3. In the navigation pane, choose Applications. On the displayed page, click Low-Code or .

      When you create an application for the first time, create a namespace as prompted. Once it is created, you cannot change or delete it, so check the details carefully. Use your company or team's abbreviation for the namespace.

    4. In the displayed dialog box, choose Standard Applications and click Confirm.
    5. Enter a label and name of the application, and click the confirm button. The application designer is displayed.
      Figure 6 Creating a blank application
      Table 1 Parameters for creating a blank application

      Parameter

      Description

      Example

      Label

      The label for the new application; Max. 80 characters. A label uniquely identifies an application in the system and cannot be modified after creation.

      My first application

      Name

      Name of the new application. After you enter the label value and click the text box of this parameter, the system automatically generates an application name and adds Namespace__ before the name. Naming rules:

      • Max. characters: 31, including the prefix namespace.

        To prevent duplicate data names among different tenants, each tenant must define a unique namespace when first creating an application. A tenant can only create one namespace, and once it is created, it cannot be modified.

      • Start with a letter and use only letters, digits, and underscores (_). Do not end with an underscore (_).

      A

  2. Create the customer object customerList and the order object orderList, and add fields to the objects.

    1. In the navigation pane, choose Data, and click + next to Object.
    2. Complete the configuration and click the confirm button.
      Figure 7 Creating the object customerList
      Table 2 Parameters for creating the customerList object

      Parameter

      Description

      Example

      Object Name

      Name of the new object, which can be changed after the object is created.

      Value: 1–80 characters.

      customerList

      Unique ID

      ID of a new object in the system, which cannot be modified after being created. Naming rules:

      • Max. 63 characters, including the prefix namespace.

        The content that is blurred in front of the ID is a namespace. To prevent duplicate data names among different tenants, each tenant must define a unique namespace when first creating an application. A tenant can only create one namespace, and once it is created, it cannot be modified.

      • Start with a letter and use only letters, digits, and underscores (_). Do not end with an underscore (_).

      customerList

    3. Click to go to the object details page.
      Figure 8 Clicking the edit button
    4. On the Fields tab page, click Add and add the customerId field for the object.
      Figure 9 Adding the customerId field
      Table 3 Parameters for adding the customerId field

      Parameter

      Description

      Example

      Display Name

      Name of the new field, which can be changed after the field is created.

      Value: 1–63 characters.

      customerId

      Unique ID

      ID of a new field in the system. The value cannot be changed after the field is created. Naming rules:

      • Max. 63 characters, including the prefix namespace.
      • Start with a letter and use only letters, digits, and an underscore (_). Do not end with an underscore (_).

      customerId

      Field Type

      Click . On the page that is displayed, select the type of the new field based on the parameter description.

      Text

      Data Length

      Length of a field that can be entered.

      64

    5. On the Fields tab page, click Add again to add the customerName field.
      Figure 10 Adding the customerName field
    6. Repeat the preceding operations to create the order object orderList and add the orderId field to it.
      Figure 11 Creating the orderList object and adding a field

  3. Select the order object and add an association.

    1. Click next to the object. The page for adding an association is displayed.
      Figure 12 Clicking the association button
    2. Select Master-Detail Relationship and click the next button.
      Master-Detail Relationship: You can establish a master/slave relationship between objects by linking the current field to another object's ID. After a master relationship is defined, the value of the current field can be obtained only from the associated master object. When the records of the object are deleted, the records of the subtables are also deleted.
      Figure 13 Selecting the master relationship
    3. Add the association and click Confirm.
      Figure 14 Adding an association
      Table 4 Parameters for adding the orderRe association

      Parameter

      Description

      Example

      Label

      Name of the association displayed on the page. The name can be changed after the association is created.

      Value: 1–80 characters.

      orderRe

      Unique ID

      Unique ID of the association in the system, which cannot be modified after being created.

      Naming rules:

      • Max. 63 characters, including the prefix namespace.
      • Start with a letter and use only letters, digits, and an underscore (_). Do not end with an underscore (_).

      orderRe

      Related Object

      Select an object from the drop-down list.

      Select the customer object customerList created in 2.

  4. Create pages for the customer and order object

    1. Select the order object orderList and choose Action > Create Page in the object editing area on the right.
      Figure 15 Clicking Create Page
    2. Deselect Form Page and retain only List Page. Click Confirm.
      Figure 16 Creating a list page for the orderList object

      After the page is created, a message shows that the page is ready. Choose Page > Standard Page to view the created list page.

    3. Use the same method to create a list page for the customer object customerList.

  5. On the order object page, set the fields to be displayed for the parent object.

    1. In the navigation pane, choose Page.
    2. Under Standard Page, choose ManageorderList.
      Figure 17 Clicking the order object page orderList
    3. Select the orderRe field, set Selection Type to Drop-Down List and Show Field to customerName in the Properties > Basic Attributes area.
      Figure 18 Setting the fields to be displayed for the parent object
    4. On the New area, select the orderRe field, set Selection Type to Drop-Down List and Show Field to customerName in the Properties > Basic Attributes area.
      Figure 19 Setting the fields to be displayed for the parent object on the New area

  6. Click in the upper part of the page to save the page settings.
  7. After the configuration is saved, click in the upper part of the page to view the configuration effect.