X4 Produktdokumentation

Operation: Read

With the Read operation of the Data Object Web App adapter, you read a data object and display the data according to a previously defined view model in your Web App.

For more information on other operations of the Data Object Web App adapter, see Data Object Web App Adapter.

Note:

To view your data in a Web App using the adapter, you must specify a view model. For more information on creating a view model, see Using a Data Model in an X4 Web App.

Parameters

referenceId

Specifies the ID of the data object to be read.

Possible values:

UUID of the data object

name

Specifies the name of the data object to be read.

Possible values:

Any valid string, e.g.: Order

viewModelReference

Specifies the name of the view model to use.

Possible values:

Name of the VIEWMODEL file, e.g.: ViewModel.viewmodel

Status values

1

The operation was successful.

-1

The operation failed due to a technical error.

Input

The adapter does not expect any specific input.

Output

The adapter outputs the data object to be read as XML within an <Ok> element.

Notes:

  • If you have not defined individual elements of your data object in the corresponding view model, the corresponding elements are not read out.

  • If you have defined elements in the corresponding view model that are not contained in the data object to be read, the corresponding elements are issued empty in the output, for example, the </MyColor> element in the following example output.

<?xml version="1.0" encoding="UTF-8"?>
<Ok>
 <Dataobject>  
  <Order>
    <OrderID>12345</Order>
    <OrderDate>2025-03-06</OrderDate>
    <Customer>
      <CustomerID>67890</CustomerID>
      <Name>John Doe</Name>
      <Email>johndoe@example.com</Email>
      <Phone>+49-7243-56175-0</Phone>
      <BillingAddress>
        <Street>Am Erlengraben 3</Street>
        <City>Ettlingen</City>
        <ZipCode>76275</ZipCode>
        <Country>Germany</Country>
      </BillingAddress>
      <ShippingAddress>
        <Street>Am Erlengraben 3</Street>
        <City>Ettlingen</City>
        <State>Baden-Württemberg</State>
        <ZipCode>76275</ZipCode>
        <Country>Germany</Country>
      </ShippingAddress>
    </Customer>
    <Items>
      <Item>
        <ItemID>98765</ItemID>
        <ProductName>MyProduct</ProcuctName>
        <Quantity>5</Quantity>
        <UnitPrice>49,99</UnitPrice>
      </Item>
      <Item>
        <ItemID>54321</ItemID>
        <ProductName>MyProduct2</ProcuctName>
        <Quantity>10</Quantity>
        <UnitPrice>19,99</UnitPrice>
      </Item>
    </Items>
    <OrderTotal>449,85</OrderTotal>
  </Order>
 </Dataobject> 
  <MyColor/>
</Ok>