# servoyDeveloper

## Overview

ONLY AVAILABLE when running a client from Servoy Developer. Do not try to use this when running clients from a normal server/war deployment.\
It is meant to be used primarily from developer's 'Interactive Console' view (so you will not get it suggested in code completion of a scope/form script editor).

It provides utility methods for interacting with the developer's environment from a debug Servoy client.\
It offers a bridge between the runtime client and the developer's workspace - allowing for changes done at runtime via solution model to be persisted into the workspace.

Look at this as a way to automate various tasks that create solution content or alter big solutions.

## Methods Summarized

| Type | Name                                                                                                 | Summary                                                                                               |
| ---- | ---------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| void | [save()](#save)                                                                                      | Saves all changes made through the solution model into the workspace.                                 |
| void | [save(override)](#save-override)                                                                     | Saves all changes made through the solution model into the workspace.                                 |
| void | [save(obj)](#save-obj)                                                                               | Saves just the given form, valuelist, relation or in memory datasource into the developers workspace. |
| void | [save(obj, override)](#save-obj-override)                                                            | Saves just the given form, valuelist, relation or in memory datasource into the developers workspace. |
| void | [save(obj, solutionName)](#save-obj-solutionname)                                                    | Saves just the given form, valuelist, relation or in memory datasource into the developers workspace. |
| void | [updateInMemDataSource(dataSource, dataset, types)](#updateinmemdatasource-datasource-dataset-types) | Updates the given in memory datasource and saves it into the developers workspace.                    |

## Methods Detailed

### save()

Saves all changes made through the solution model into the workspace.\
Please note that this method only saves the new in memory datasources,\
if you would like to override the existing ones use servoyDeveloper.save(true).

**Returns:** void

### save(override)

Saves all changes made through the solution model into the workspace.

**Parameters**

* [Boolean](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/boolean) **override** Override existing in memory tables.

**Returns:** void

### save(obj)

Saves just the given form, valuelist, relation or in memory datasource into the developers workspace.\
This must be a solution created or altered form/in memory datasource.

**Parameters**

* [Object](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/object) **obj** The formname, JSForm, JSValueList, JSRelation, datasource name or JSDataSource object to save.

**Returns:** void

### save(obj, override)

Saves just the given form, valuelist, relation or in memory datasource into the developers workspace.\
This must be a solution created or altered form/in memory datasource.

**Parameters**

* [Object](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/object) **obj** The formname, JSForm, JSValueList, JSRelation, datasource name or JSDataSource object to save.
* [Boolean](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/boolean) **override** Override an existing in memory table.

**Returns:** void

### save(obj, solutionName)

Saves just the given form, valuelist, relation or in memory datasource into the developers workspace.\
This must be a solution created form/in memory datasource.\
NOTE: The current method can only be used for new objects.\
For existing objects, please use the save method with the override flag set to true.\
It is not needed to specify the solution, because the object to be updated will be saved in the right solution.

**Parameters**

* [Object](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/object) **obj** The formname, JSForm, JSValueList, JSRelation, datasource name or JSDataSource object to save.
* [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string) **solutionName** The destination solution, a module of the active solution.

**Returns:** void

### updateInMemDataSource(dataSource, dataset, types)

Updates the given in memory datasource and saves it into the developers workspace.

**Parameters**

* [Object](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/object) **dataSource** datasource name or JSDataSource object to save.
* [Object](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/object) **dataset** the dataset with the update columns
* [Object](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/object) **types** array of the update columns types

**Returns:** void

***
