# saveStructure

Saves a Config Structure with embedded child entities. All Ids are automatically assigned from parent to childs. All arrays must be grids with the subdatasource of config. You only need to specify the fields you would like to insert.

```javascript
app.saveStructure({
   "inboundInvoice":[
      {
         "iiBarcode":"ERA30321",
         "iiTransferType":"ERA",
         "iiTransferDate":"2024-07-29",
         "iiPeriod":"07.2024",
         "iiTransNumber":"",
         "iiPersonalAccount":"60005",
         "iiGrandTotalAmount":"1762.000000000000000000",
         "iiVatTotalAmount":"281.000000000000000000",
         "iiNetTotalAmount":"1481.000000000000000000",
         "iiBrixxboxCreateDate":"2023-07-10 10:25:00",
         "iiApprovalDate":"2023-07-11 12:44:00",
         "iiApprovalUserId":"8",
         "iiDiamantApprovalDate":"2023-07-11 08:41:00",
         "linesGrid":[
            {
               "iilInboundInvoiceId":null,
               "iilQuantity":null,
               "iilUnitPrice":698.5,
               "iilTotalAmount":698.5,
               "iilInvoiceOrderId":null
            },
            {
               "iilInboundInvoiceId":null,
               "iilQuantity":null,
               "iilUnitPrice":195.6,
               "iilTotalAmount":782.4,
               "iilInvoiceOrderId":null
            }
         ]
      }
   ]
})
```

In this example we are creating an inbound Invoice with two lines


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://brixxbox.gitbook.io/brixxbox-documentation/client-api-reference/functions/savestructure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
