---
description: Starts a Gebra Suite app.
---

# startApp

## Parameters

1. startOptions - This is a json object with the start parameters:
   * appName - name of the config as string
   * noInitialRefresh - the grids of the target apps are not refreshed on startup. Can be used if you send additionalValues for the selection and you want to avoid to fetch data, that will be imidiately replaced with the correct filtered data.
   * parentApp - the parent for the new api. If not set, this will be set to app from the caller, your current api.
   * id - (optional) id of the record to load in the new app
   * startMode - (optional)
     * "modal" will start in a modal overlay window (default),
     * "tab" will start the app in a new tab. You will not get a app object as a result in this case!
     * "page" will replace the content in the current browser tab
     * "invisible" will not show the app
   * appMode - (optional)
     * "form" will start the app as a Form (default),
     * "list" will start the app as a List of Records,
   * additionalValues (optional): json object of control values that should be set in the new app
   * parameters: (optional): json array of parameter flags (the flags you can choose in the menu endpoint editor) to set for the new app
   * container: (optional): a jQuery object to a div, where the new Gebra Suite will be embedded

## Return value

If a Gebra Suite is started in "modal" mode, the function returns the app object of the new app. You have to **await** the result (Example 3) to use it.

## Example Usages

This will start the app "myapp" in a modal dialog.

```javascript
app.startApp({ appName: "myapp" }); //starts myapp as a form

app.startApp({ appName: "myapp", appMode: "list" }); //starts myapp as a list
```

This will start the app "myapp" in a modal dialog, load the record with id 1 and set the values of the 2 controls "addressNo" and "orderNo" inside the new app

```javascript
let startOptions = {
  appName: "myapp",
  id: 1,
  startMode: "modal",
  additionalValues: {
    addressNo: 123,
    orderNo: 456,
  },
  parameters: ["openOrders", "shippedORders"],
};
app.startApp(startOptions);
```

This will start the app "myapp" in a modal dialog, and add an addEventListener for the save event.

```javascript
let modalApp = await app.startApp({ appName: "myapp" });
modalapp.addEventListener("onRecordSaved", function (modalApp, eventArgs) {
  alert("Record saved in " + modalApp.appName);
});
```

### Return Values

The startApp function returns the API object for the Brixxbox application that was started, allowing the calling code to interact with the application.
