Creating Multi-level Insert Operations for Web Service Mobile Business Objects

Create a multi-level insert operation for two Web service mobile business objects (MBOs).

In this example, you have two MBOs, Order and OrderItem, that both have defined create (insert) operations: the OrderItem.create operation requires the Order.id, but Order.id is assigned by the enterprise information system (EIS) and not available until the order is created in the EIS. You can create a multilevel insert operation to address this problem. When creating the multilevel insert (create) operation:

  1. Create a Web service connection profile to the data source from which you created the MBOs.
  2. Create attributes of the parent MBO (Order). For example, you can drag and drop the Web service data source onto the Mobile Application Diagram, and use the Quick Create wizard to define the MBO.
    Define the MBO create operation.
    Note: Web service multilevel inserts support SOAP bindings only.
  3. Click Finish.
  4. Set or verify the Fill from attribute setting:
    1. In the Mobile Application Diagram, double-click the create operation that serves as the insert operation for the parent MBO.
    2. From the left side of the Properties view, select the Parameters tab.
    3. Verify that each argument name has a corresponding Fill from attribute value defined.
      All arguments of the create operation in the parent MBO and the child MBO must be set to the related Fill from attribute value. By default, the related value is set automatically, but in some cases the value cannot be found, so double check the values.
  5. Set or verify the Primary key setting:
    1. In the Mobile Application Diagram select within the header of the MBO to view the MBO properties in the Properties view.
    2. From the left side of the Properties view, select the Attributes tab located on the left, then the Attributes Mapping tab located on the top.
    3. Locate and select the Primary key check box for the attribute that serves as the primary-key equivalent for the parent MBO (for example, Id).
  6. Create the child MBO (OrderItem) the same way you created the parent – drag and drop the data source onto the Mobile Application Diagram, and follow the Quick Create wizard instructions to create the attributes and operations.
  7. From the Properties view, verify that each argument name of the create operation has a corresponding Fill from attribute setting.
  8. In the Mobile Application Diagram, click Relationship, and use the wizard to define a relationship between the MBOs. For example, link the Source object Order "Id" attribute to the Target object OrderItem "Id." Select Composite and One to many.

    Synchronization of the child MBO should occur either independently or through the parent MBO. See the Client Object API documentation for details.