Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Rev: 1381948887907

...

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#nullColumnValidatorEnablednullColumnValidatorEnabled
Enable/disable the default null validator for non null columns, makes it possible todo the checks later on when saving, when for example autosave is disabled.

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#acquireLockacquireLock(foundset, recordIndex)
Request lock(s) for a foundset, can be a normal or related foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#acquireLockacquireLock(foundset, recordIndex, lockName)
Request lock(s) for a foundset, can be a normal or related foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#addTableFilterParamaddTableFilterParam(datasource, dataprovider, operator, value)
Adds a filter to all the foundsets based on a table.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#addTableFilterParamaddTableFilterParam(datasource, dataprovider, operator, value, filterName)
Adds a filter to all the foundsets based on a table.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#addTableFilterParamaddTableFilterParam(serverName, tableName, dataprovider, operator, value)
Adds a filter to all the foundsets based on a table.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#addTableFilterParamaddTableFilterParam(serverName, tableName, dataprovider, operator, value, filterName)
Adds a filter to all the foundsets based on a table.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addTrackingInfoaddTrackingInfo(columnName, value)
Add tracking info used in the log table.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#commitTransactioncommitTransaction()
Returns true if a transaction is committed; rollback if commit fails.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#commitTransactioncommitTransaction(saveFirst)
Returns true if a transaction is committed; rollback if commit fails.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#commitTransactioncommitTransaction(saveFirst, revertSavedRecords)
Returns true if a transaction is committed; rollback if commit fails.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSFoundSet
Table Cell (td)
#convertFoundSetconvertFoundSet(foundset, related)
Creates a foundset that combines all the records of the specified one-to-many relation seen from the given parent/primary foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSFoundSet
Table Cell (td)
#convertFoundSetconvertFoundSet(foundset, related)
Creates a foundset that combines all the records of the specified one-to-many relation seen from the given parent/primary foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
#convertToDataSetconvertToDataSet(foundset)
Converts the argument to a JSDataSet, possible use in controller.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
#convertToDataSetconvertToDataSet(foundset, dataproviderNames)
Converts the argument to a JSDataSet, possible use in controller.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
#convertToDataSetconvertToDataSet(values)
Converts the argument to a JSDataSet, possible use in controller.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
#convertToDataSetconvertToDataSet(values, dataproviderNames)
Converts the argument to a JSDataSet, possible use in controller.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
#convertToDataSetconvertToDataSet(ids)
Converts the argument to a JSDataSet, possible use in controller.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#copyMatchingFieldscopyMatchingFields(source, destination)
Copies all matching non empty columns (if overwrite boolean is given all columns except pk/ident, if array then all columns except pk and array names).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#copyMatchingFieldscopyMatchingFields(source, destination, overwrite)
Copies all matching non empty columns (if overwrite boolean is given all columns except pk/ident, if array then all columns except pk and array names).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#copyMatchingFieldscopyMatchingFields(source, destination, names)
Copies all matching non empty columns (if overwrite boolean is given all columns except pk/ident, if array then all columns except pk and array names).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
createDataSourceByQuery(name, query, max_returned_rows)
Performs a query and saves the result in a datasource.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#createDataSourceByQuerycreateDataSourceByQuery(name, query, max_returned_rows, types)
Performs a query and saves the result in a datasource.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#createDataSourceByQuerycreateDataSourceByQuery(name, query, max_returned_rows, types, pkNames)
Performs a query and saves the result in a datasource.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
createDataSourceByQuery(name, server_name, sql_query, arguments, max_returned_rows)
Performs a sql query on the specified server, saves the the result in a datasource.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#createDataSourceByQuerycreateDataSourceByQuery(name, server_name, sql_query, arguments, max_returned_rows, types)
Performs a sql query on the specified server, saves the the result in a datasource.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#createDataSourceByQuerycreateDataSourceByQuery(name, server_name, sql_query, arguments, max_returned_rows, types, pkNames)
Performs a sql query on the specified server, saves the the result in a datasource.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
#createEmptyDataSetcreateEmptyDataSet()
Returns an empty dataset object.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
#createEmptyDataSetcreateEmptyDataSet(rowCount, columnCount)
Returns an empty dataset object.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
#createEmptyDataSetcreateEmptyDataSet(rowCount, columnNames)
Returns an empty dataset object.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
QBSelect
Table Cell (td)
#createSelectcreateSelect(dataSource)
Create a QueryBuilder object for a datasource.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#dataSourceExistsdataSourceExists(datasource)
Check wether a data source exists.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#getAutoSavegetAutoSave()
Returns true or false if autosave is enabled or disabled.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
#getDataModelClonesFromgetDataModelClonesFrom(serverName)
Retrieves a list with names of all database servers that have property DataModelCloneFrom equal to the server name parameter.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
#getDataSetByQuerygetDataSetByQuery(query, max_returned_rows)
Performs a sql query with a query builder object.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
#getDataSetByQuerygetDataSetByQuery(server_name, sql_query, arguments, max_returned_rows)
Performs a sql query on the specified server, returns the result in a dataset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getDataSourcegetDataSource(serverName, tableName)
Returns the datasource corresponding to the given server/table.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getDataSourceServerNamegetDataSourceServerName(dataSource)
Returns the server name from the datasource, or null if not a database datasource.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getDataSourceTableNamegetDataSourceTableName(dataSource)
Returns the table name from the datasource, or null if not a database datasource.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getDatabaseProductNamegetDatabaseProductName(serverName)
Returns the database product name as supplied by the driver for a server.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSRecord[]
Table Cell (td)
#getEditedRecordsgetEditedRecords()
Returns an array of edited records with outstanding (unsaved) data.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSRecord[]
Table Cell (td)
#getEditedRecordsgetEditedRecords(foundset)
Returns an array of edited records with outstanding (unsaved) data.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSRecord[]
Table Cell (td)
#getFailedRecordsgetFailedRecords()
Returns an array of records that fail after a save.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSRecord[]
Table Cell (td)
#getFailedRecordsgetFailedRecords(foundset)
Returns an array of records that fail after a save.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSFoundSet
Table Cell (td)
#getFoundSetgetFoundSet(query)
Returns a foundset object for a specified pk query.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSFoundSet
Table Cell (td)
#getFoundSetgetFoundSet(dataSource)
Returns a foundset object for a specified datasource or server and tablename.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSFoundSet
Table Cell (td)
#getFoundSetgetFoundSet(serverName, tableName)
Returns a foundset object for a specified datasource or server and tablename.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getFoundSetCountgetFoundSetCount(foundset)
Returns the total number of records in a foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSFoundSetUpdater
Table Cell (td)
#getFoundSetUpdatergetFoundSetUpdater(foundset)
Returns a JSFoundsetUpdater object that can be used to update all or a specific number of rows in the specified foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
#getNextSequencegetNextSequence(dataSource, columnName)
Gets the next sequence for a column which has a sequence defined in its column dataprovider properties.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getSQLgetSQL(foundset)
Returns the internal SQL which defines the specified (related)foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getSQLgetSQL(foundset, includeFilters)
Returns the internal SQL which defines the specified (related)foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object[]
Table Cell (td)
#getSQLParametersgetSQLParameters(foundset)
Returns the internal SQL parameters, as an array, that are used to define the specified (related)foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object[]
Table Cell (td)
#getSQLParametersgetSQLParameters(foundset, includeFilters)
Returns the internal SQL parameters, as an array, that are used to define the specified (related)foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
#getServerNamesgetServerNames()
Returns an array with all the server names used in the solution.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSTable
Table Cell (td)
#getTablegetTable(foundset)
Returns the JSTable object from which more info can be obtained (like columns).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSTable
Table Cell (td)
#getTablegetTable(record)
Returns the JSTable object from which more info can be obtained (like columns).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSTable
Table Cell (td)
#getTablegetTable(dataSource)
Returns the JSTable object from which more info can be obtained (like columns).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSTable
Table Cell (td)
#getTablegetTable(serverName, tableName)
Returns the JSTable object from which more info can be obtained (like columns).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getTableCountgetTableCount(dataSource)
Returns the total number of records(rows) in a table.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object[][]
Table Cell (td)
#getTableFilterParamsgetTableFilterParams(serverName)
Returns a two dimensional array object containing the table filter information currently applied to the servers tables.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object[][]
Table Cell (td)
#getTableFilterParamsgetTableFilterParams(serverName, filterName)
Returns a two dimensional array object containing the table filter information currently applied to the servers tables.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
#getTableNamesgetTableNames(serverName)
Returns an array of all table names for a specified server.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
#getViewNamesgetViewNames(serverName)
Returns an array of all view names for a specified server.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hasLockshasLocks()
Returns true if the current client has any or the specified lock(s) acquired.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hasLockshasLocks(lockName)
Returns true if the current client has any or the specified lock(s) acquired.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hasNewRecordshasNewRecords(foundset)
Returns true if the argument (foundSet / record) has at least one row that was not yet saved in the database.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hasNewRecordshasNewRecords(foundset, index)
Returns true if the argument (foundSet / record) has at least one row that was not yet saved in the database.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hasRecordChangeshasRecordChanges(foundset)
Returns true if the specified foundset, on a specific index or in any of its records, or the specified record has changes.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hasRecordChangeshasRecordChanges(foundset, index)
Returns true if the specified foundset, on a specific index or in any of its records, or the specified record has changes.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hasRecordshasRecords(foundset)
Returns true if the (related)foundset exists and has records.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hasRecordshasRecords(record, relationString)
Returns true if the (related)foundset exists and has records.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hasTransactionhasTransaction()
Returns true if there is an transaction active for this client.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#mergeRecordsmergeRecords(sourceRecord, combinedDestinationRecord)
Merge records from the same foundset, updates entire datamodel (via foreign type on columns) with destination
record pk, deletes source record.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#mergeRecordsmergeRecords(sourceRecord, combinedDestinationRecord, columnNames)
Merge records from the same foundset, updates entire datamodel (via foreign type on columns) with destination
record pk, deletes source record.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#recalculaterecalculate(foundsetOrRecord)
Can be used to recalculate a specified record or all rows in the specified foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#refreshRecordFromDatabaserefreshRecordFromDatabase(foundset, index)
Flushes the client data cache and requeries the data for a record (based on the record index) in a foundset or all records in the foundset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#releaseAllLocksreleaseAllLocks()
Release all current locks the client has (optionally limited to named locks).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#releaseAllLocksreleaseAllLocks(lockName)
Release all current locks the client has (optionally limited to named locks).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#removeTableFilterParamremoveTableFilterParam(serverName, filterName)
Removes a previously defined table filter.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#revertEditedRecordsrevertEditedRecords()
Reverts outstanding (not saved) in memory changes from edited records.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#revertEditedRecordsrevertEditedRecords(foundset)
Reverts outstanding (not saved) in memory changes from edited records.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#rollbackTransactionrollbackTransaction()
Rollback a transaction started by databaseManager.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#rollbackTransactionrollbackTransaction(rollbackEdited)
Rollback a transaction started by databaseManager.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#rollbackTransactionrollbackTransaction(rollbackEdited, revertSavedRecords)
Rollback a transaction started by databaseManager.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#saveDatasaveData()
Saves all outstanding (unsaved) data and exits the current record.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#saveDatasaveData(foundset)
Saves all outstanding (unsaved) data and exits the current record.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#saveDatasaveData(record)
Saves all outstanding (unsaved) data and exits the current record.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#setAutoSavesetAutoSave(autoSave)
Set autosave, if false then no saves will happen by the ui (not including deletes!).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setCreateEmptyFormFoundsetssetCreateEmptyFormFoundsets()
Turnoff the initial form foundset record loading, set this in the solution open method.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#startTransactionstartTransaction()
Start a database transaction.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#switchServerswitchServer(sourceName, destinationName)
Switches a named server to another named server with the same datamodel (recommended to be used in an onOpen method for a solution).

HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details
Table Body (tbody)
idnullColumnValidatorEnabled
Table Row (tr)
idname
Table Cell (td)
nullColumnValidatorEnabled
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Enable/disable the default null validator for non null columns, makes it possible todo the checks later on when saving, when for example autosave is disabled.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

databaseManager.nullColumnValidatorEnabled = false;//disable

//test if enabled
if(databaseManager.nullColumnValidatorEnabled) application.output('null validation enabled')

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idacquireLock-JSFoundSet_Number
Table Row (tr)
idname
Table Cell (td)
acquireLock
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
acquireLock
Span
(foundset, recordIndex)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Request lock(s) for a foundset, can be a normal or related foundset.
The record_index can be -1 to lock all rows, 0 to lock the current row, or a specific row of > 0
Optionally name the lock(s) so that it can be referenced it in releaseAllLocks()

returns true if the lock could be acquired.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{JSFoundSet} foundset

...

- The JSFoundset to get the lock for
{Number} recordIndex

...

- The record index which should be locked.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- true if the lock could be acquired.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

//locks the complete foundset
databaseManager.acquireLock(foundset,-1);

//locks the current row
databaseManager.acquireLock(foundset,0);

//locks all related orders for the current Customer
var success = databaseManager.acquireLock(Cust_to_Orders,-1);
if(!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to get a lock','OK');
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idacquireLock-JSFoundSet_Number_String
Table Row (tr)
idname
Table Cell (td)
acquireLock
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
acquireLock
Span
(foundset, recordIndex, lockName)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Request lock(s) for a foundset, can be a normal or related foundset.
The record_index can be -1 to lock all rows, 0 to lock the current row, or a specific row of > 0
Optionally name the lock(s) so that it can be referenced it in releaseAllLocks()

returns true if the lock could be acquired.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{JSFoundSet} foundset

...

- The JSFoundset to get the lock for
{Number} recordIndex

...

- The record index which should be locked.
{String} lockName

...

- The name of the lock.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- true if the lock could be acquired.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

//locks the complete foundset
databaseManager.acquireLock(foundset,-1);

//locks the current row
databaseManager.acquireLock(foundset,0);

//locks all related orders for the current Customer
var success = databaseManager.acquireLock(Cust_to_Orders,-1);
if(!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to get a lock','OK');
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddTableFilterParam-String_String_String_Object
Table Row (tr)
idname
Table Cell (td)
addTableFilterParam
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
addTableFilterParam
Span
(datasource, dataprovider, operator, value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Adds a filter to all the foundsets based on a table.
Note: if null is provided as the tablename the filter will be applied on all tables with the dataprovider name.
A dataprovider can have multiple filters defined, they will all be applied.
returns true if the tablefilter could be applied.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} datasource

...

- The datasource
{String} dataprovider

...

- A specified dataprovider column name.
{String} operator

...

- One of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null).
{Object} value

...

- The specified filter value.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- true if the tablefilter could be applied.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// Best way to call this in a global solution startup method, but filters may be added/removed at any time.
// Note that multiple filters can be added to the same dataprovider, they will all be applied.

// filter on messages table where messagesid>10, the filter has a name so it can be removed using databaseManager.removeTableFilterParam()
var success = databaseManager.addTableFilterParam('admin', 'messages', 'messagesid', '>', 10, 'higNumberedMessagesRule')

// all tables that have the companyid column should be filtered
var success = databaseManager.addTableFilterParam('crm', null, 'companyidid', '=', currentcompanyid)

// some filters with in-conditions
var success = databaseManager.addTableFilterParam('crm', 'products', 'productcode', 'in', [120, 144, 200])
var success = databaseManager.addTableFilterParam('crm', 'orders', 'countrycode', 'in', 'select country code from countries where region = "Europe"')

// you can use modifiers in the operator as well, filter on companies where companyname is null or equals-ignore-case 'servoy'
var success = databaseManager.addTableFilterParam('crm', 'companies', 'companyname', '#^||=', 'servoy')

// the value may be null, this will result in 'column is null' sql condition.
var success = databaseManager.addTableFilterParam('crm', 'companies', 'verified', '=', null)

//if you want to add a filter for a column (created by you) in the i18n table

...

databaseManager.addTableFilterParam('database', 'your_i18n_table', 'message_variant', 'in', [1, 2])

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddTableFilterParam-String_String_String_Object_String
Table Row (tr)
idname
Table Cell (td)
addTableFilterParam
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
addTableFilterParam
Span
(datasource, dataprovider, operator, value, filterName)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Adds a filter to all the foundsets based on a table.
Note: if null is provided as the tablename the filter will be applied on all tables with the dataprovider name.
A dataprovider can have multiple filters defined, they will all be applied.
returns true if the tablefilter could be applied.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} datasource

...

- The datasource
{String} dataprovider

...

- A specified dataprovider column name.
{String} operator

...

- One of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null).
{Object} value

...

- The specified filter value.
{String} filterName

...

- The specified name of the database table filter.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- true if the tablefilter could be applied.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// Best way to call this in a global solution startup method, but filters may be added/removed at any time.
// Note that multiple filters can be added to the same dataprovider, they will all be applied.

// filter on messages table where messagesid>10, the filter has a name so it can be removed using databaseManager.removeTableFilterParam()
var success = databaseManager.addTableFilterParam('admin', 'messages', 'messagesid', '>', 10, 'higNumberedMessagesRule')

// all tables that have the companyid column should be filtered
var success = databaseManager.addTableFilterParam('crm', null, 'companyidid', '=', currentcompanyid)

// some filters with in-conditions
var success = databaseManager.addTableFilterParam('crm', 'products', 'productcode', 'in', [120, 144, 200])
var success = databaseManager.addTableFilterParam('crm', 'orders', 'countrycode', 'in', 'select country code from countries where region = "Europe"')

// you can use modifiers in the operator as well, filter on companies where companyname is null or equals-ignore-case 'servoy'
var success = databaseManager.addTableFilterParam('crm', 'companies', 'companyname', '#^||=', 'servoy')

// the value may be null, this will result in 'column is null' sql condition.
var success = databaseManager.addTableFilterParam('crm', 'companies', 'verified', '=', null)

//if you want to add a filter for a column (created by you) in the i18n table

...

databaseManager.addTableFilterParam('database', 'your_i18n_table', 'message_variant', 'in', [1, 2])

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddTableFilterParam-String_String_String_String_Object
Table Row (tr)
idname
Table Cell (td)
addTableFilterParam
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
addTableFilterParam
Span
(serverName, tableName, dataprovider, operator, value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Adds a filter to all the foundsets based on a table.
Note: if null is provided as the tablename the filter will be applied on all tables with the dataprovider name.
A dataprovider can have multiple filters defined, they will all be applied.
returns true if the tablefilter could be applied.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} serverName

...

- The name of the database server connection for the specified table name.
{String} tableName

...

- The name of the specified table.
{String} dataprovider

...

- A specified dataprovider column name.
{String} operator

...

- One of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null).
{Object} value

...

- The specified filter value.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- true if the tablefilter could be applied.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// Best way to call this in a global solution startup method, but filters may be added/removed at any time.
// Note that multiple filters can be added to the same dataprovider, they will all be applied.

// filter on messages table where messagesid>10, the filter has a name so it can be removed using databaseManager.removeTableFilterParam()
var success = databaseManager.addTableFilterParam('admin', 'messages', 'messagesid', '>', 10, 'higNumberedMessagesRule')

// all tables that have the companyid column should be filtered
var success = databaseManager.addTableFilterParam('crm', null, 'companyidid', '=', currentcompanyid)

// some filters with in-conditions
var success = databaseManager.addTableFilterParam('crm', 'products', 'productcode', 'in', [120, 144, 200])
var success = databaseManager.addTableFilterParam('crm', 'orders', 'countrycode', 'in', 'select country code from countries where region = "Europe"')

// you can use modifiers in the operator as well, filter on companies where companyname is null or equals-ignore-case 'servoy'
var success = databaseManager.addTableFilterParam('crm', 'companies', 'companyname', '#^||=', 'servoy')

// the value may be null, this will result in 'column is null' sql condition.
var success = databaseManager.addTableFilterParam('crm', 'companies', 'verified', '=', null)

//if you want to add a filter for a column (created by you) in the i18n table

...

databaseManager.addTableFilterParam('database', 'your_i18n_table', 'message_variant', 'in', [1, 2])

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddTableFilterParam-String_String_String_String_Object_String
Table Row (tr)
idname
Table Cell (td)
addTableFilterParam
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
addTableFilterParam
Span
(serverName, tableName, dataprovider, operator, value, filterName)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Adds a filter to all the foundsets based on a table.
Note: if null is provided as the tablename the filter will be applied on all tables with the dataprovider name.
A dataprovider can have multiple filters defined, they will all be applied.
returns true if the tablefilter could be applied.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} serverName

...

- The name of the database server connection for the specified table name.
{String} tableName

...

- The name of the specified table.
{String} dataprovider

...

- A specified dataprovider column name.
{String} operator

...

- One of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null).
{Object} value

...

- The specified filter value.
{String} filterName

...

- The specified name of the database table filter.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- true if the tablefilter could be applied.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// Best way to call this in a global solution startup method, but filters may be added/removed at any time.
// Note that multiple filters can be added to the same dataprovider, they will all be applied.

// filter on messages table where messagesid>10, the filter has a name so it can be removed using databaseManager.removeTableFilterParam()
var success = databaseManager.addTableFilterParam('admin', 'messages', 'messagesid', '>', 10, 'higNumberedMessagesRule')

// all tables that have the companyid column should be filtered
var success = databaseManager.addTableFilterParam('crm', null, 'companyidid', '=', currentcompanyid)

// some filters with in-conditions
var success = databaseManager.addTableFilterParam('crm', 'products', 'productcode', 'in', [120, 144, 200])
var success = databaseManager.addTableFilterParam('crm', 'orders', 'countrycode', 'in', 'select country code from countries where region = "Europe"')

// you can use modifiers in the operator as well, filter on companies where companyname is null or equals-ignore-case 'servoy'
var success = databaseManager.addTableFilterParam('crm', 'companies', 'companyname', '#^||=', 'servoy')

// the value may be null, this will result in 'column is null' sql condition.
var success = databaseManager.addTableFilterParam('crm', 'companies', 'verified', '=', null)

//if you want to add a filter for a column (created by you) in the i18n table

...

databaseManager.addTableFilterParam('database', 'your_i18n_table', 'message_variant', 'in', [1, 2])

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddTrackingInfo-String_Object
Table Row (tr)
idname
Table Cell (td)
addTrackingInfo
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
addTrackingInfo
Span
(columnName, value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add tracking info used in the log table.
When tracking is enabled and a new row is inserted in the log table,
if it has a column named 'columnName', its value will be set with 'value'
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} columnName

...

- The name of the column in the log table, used for tracking info
{Object} value

...

- The value to be set when inserting a new row in the log table, for the 'columnName' column
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

databaseManager.addTrackingInfo('log_column_name', 'trackingInfo')

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcommitTransaction
Table Row (tr)
idname
Table Cell (td)
commitTransaction
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
commitTransaction
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns true if a transaction is committed; rollback if commit fails.
Saves all edited records and commits the data.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- if the transaction could be committed.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// starts a database transaction
databaseManager.startTransaction()
//Now let users input data

//when data has been entered do a commit or rollback if the data entry is canceld or the the commit did fail.

...

if (cancel || !databaseManager.commitTransaction())
{
	databaseManager.rollbackTransaction();
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcommitTransaction-Boolean
Table Row (tr)
idname
Table Cell (td)
commitTransaction
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
commitTransaction
Span
(saveFirst)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns true if a transaction is committed; rollback if commit fails.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Boolean} saveFirst

...

- save edited records to the database first (default true)
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- if the transaction could be committed.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// starts a database transaction
databaseManager.startTransaction()
//Now let users input data

//when data has been entered do a commit or rollback if the data entry is canceld or the the commit did fail.

...

if (cancel || !databaseManager.commitTransaction())
{
	databaseManager.rollbackTransaction();
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcommitTransaction-Boolean_Boolean
Table Row (tr)
idname
Table Cell (td)
commitTransaction
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
commitTransaction
Span
(saveFirst, revertSavedRecords)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns true if a transaction is committed; rollback if commit fails.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Boolean} saveFirst

...

- save edited records to the database first (default true)
{Boolean} revertSavedRecords

...

- if a commit fails and a rollback is done, the when given false the records are not reverted to the database state (and are in edited records again)
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- if the transaction could be committed.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// starts a database transaction
databaseManager.startTransaction()
//Now let users input data

//when data has been entered do a commit or rollback if the data entry is canceld or the the commit did fail.

...

if (cancel || !databaseManager.commitTransaction())
{
	databaseManager.rollbackTransaction();
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idconvertFoundSet-JSFoundSet_JSFoundSet
Table Row (tr)
idname
Table Cell (td)
convertFoundSet
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSFoundSet
Span
stylefont-weight: bold;
convertFoundSet
Span
(foundset, related)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Creates a foundset that combines all the records of the specified one-to-many relation seen from the given parent/primary foundset.
The created foundset will not contain records that have not been saved in the database, because the records in the foundset will be the
result of a select query to the database.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{JSFoundSet} foundset

...

- The JSFoundset to convert.
{JSFoundSet} related

...

- can be a one-to-many relation object or the name of a one-to-many relation
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSFoundSet

...

- The converted JSFoundset.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// Convert in the order form a orders foundset into a orderdetails foundset,

...

// that has all the orderdetails from all the orders in the foundset.
var convertedFoundSet = databaseManager.convertFoundSet(foundset,order_to_orderdetails);
// or var convertedFoundSet = databaseManager.convertFoundSet(foundset,"order_to_orderdetails");
forms.orderdetails.controller.showRecords(convertedFoundSet);

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idconvertFoundSet-JSFoundSet_String
Table Row (tr)
idname
Table Cell (td)
convertFoundSet
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSFoundSet
Span
stylefont-weight: bold;
convertFoundSet
Span
(foundset, related)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Creates a foundset that combines all the records of the specified one-to-many relation seen from the given parent/primary foundset.
The created foundset will not contain records that have not been saved in the database, because the records in the foundset will be the
result of a select query to the database.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{JSFoundSet} foundset

...

- The JSFoundset to convert.
{String} related

...

- the name of a one-to-many relation
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSFoundSet

...

- The converted JSFoundset.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// Convert in the order form a orders foundset into a orderdetails foundset,

...

// that has all the orderdetails from all the orders in the foundset.
var convertedFoundSet = databaseManager.convertFoundSet(foundset,order_to_orderdetails);
// or var convertedFoundSet = databaseManager.convertFoundSet(foundset,"order_to_orderdetails");
forms.orderdetails.controller.showRecords(convertedFoundSet);

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idconvertToDataSet-JSFoundSet
Table Row (tr)
idname
Table Cell (td)
convertToDataSet
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSDataSet
Span
stylefont-weight: bold;
convertToDataSet
Span
(foundset)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Converts the argument to a JSDataSet, possible use in controller.loadRecords(dataset).
The optional array of dataprovider names is used (only) to add the specified dataprovider names as columns to the dataset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{JSFoundSet} foundset

...

- The foundset to be converted.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSDataSet

...

- JSDataSet with the data.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// converts a foundset pks to a dataset
var dataset = databaseManager.convertToDataSet(foundset);
// converts a foundset to a dataset
//var dataset = databaseManager.convertToDataSet(foundset,['product_id','product_name']);
// converts an object array to a dataset
//var dataset = databaseManager.convertToDataSet(files,['name','path']);
// converts an array to a dataset
//var dataset = databaseManager.convertToDataSet(new Array(1,2,3,4,5,6));
// converts an string list to a dataset
//var dataset = databaseManager.convertToDataSet('4,5,6');

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idconvertToDataSet-JSFoundSet_StringArray
Table Row (tr)
idname
Table Cell (td)
convertToDataSet
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSDataSet
Span
stylefont-weight: bold;
convertToDataSet
Span
(foundset, dataproviderNames)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Converts the argument to a JSDataSet, possible use in controller.loadRecords(dataset).
The optional array of dataprovider names is used (only) to add the specified dataprovider names as columns to the dataset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{JSFoundSet} foundset

...

- The foundset to be converted.
{String[]} dataproviderNames

...

- Array with column names.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSDataSet

...

- JSDataSet with the data.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// converts a foundset pks to a dataset
var dataset = databaseManager.convertToDataSet(foundset);
// converts a foundset to a dataset
//var dataset = databaseManager.convertToDataSet(foundset,['product_id','product_name']);
// converts an object array to a dataset
//var dataset = databaseManager.convertToDataSet(files,['name','path']);
// converts an array to a dataset
//var dataset = databaseManager.convertToDataSet(new Array(1,2,3,4,5,6));
// converts an string list to a dataset
//var dataset = databaseManager.convertToDataSet('4,5,6');

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idconvertToDataSet-ObjectArray
Table Row (tr)
idname
Table Cell (td)
convertToDataSet
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSDataSet
Span
stylefont-weight: bold;
convertToDataSet
Span
(values)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Converts the argument to a JSDataSet, possible use in controller.loadRecords(dataset).
The optional array of dataprovider names is used (only) to add the specified dataprovider names as columns to the dataset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object[]} values

...

- The values array.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSDataSet

...

- JSDataSet with the data.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// converts a foundset pks to a dataset
var dataset = databaseManager.convertToDataSet(foundset);
// converts a foundset to a dataset
//var dataset = databaseManager.convertToDataSet(foundset,['product_id','product_name']);
// converts an object array to a dataset
//var dataset = databaseManager.convertToDataSet(files,['name','path']);
// converts an array to a dataset
//var dataset = databaseManager.convertToDataSet(new Array(1,2,3,4,5,6));
// converts an string list to a dataset
//var dataset = databaseManager.convertToDataSet('4,5,6');

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idconvertToDataSet-ObjectArray_StringArray
Table Row (tr)
idname
Table Cell (td)
convertToDataSet
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSDataSet
Span
stylefont-weight: bold;
convertToDataSet
Span
(values, dataproviderNames)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Converts the argument to a JSDataSet, possible use in controller.loadRecords(dataset).
The optional array of dataprovider names is used (only) to add the specified dataprovider names as columns to the dataset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object[]} values

...

- The values array.
{String[]} dataproviderNames

...

- The property names array.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSDataSet

...

- JSDataSet with the data.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// converts a foundset pks to a dataset
var dataset = databaseManager.convertToDataSet(foundset);
// converts a foundset to a dataset
//var dataset = databaseManager.convertToDataSet(foundset,['product_id','product_name']);
// converts an object array to a dataset
//var dataset = databaseManager.convertToDataSet(files,['name','path']);
// converts an array to a dataset
//var dataset = databaseManager.convertToDataSet(new Array(1,2,3,4,5,6));
// converts an string list to a dataset
//var dataset = databaseManager.convertToDataSet('4,5,6');

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idconvertToDataSet-String
Table Row (tr)
idname
Table Cell (td)
convertToDataSet
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSDataSet
Span
stylefont-weight: bold;
convertToDataSet
Span
(ids)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Converts the argument to a JSDataSet, possible use in controller.loadRecords(dataset).
The optional array of dataprovider names is used (only) to add the specified dataprovider names as columns to the dataset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} ids

...

- Concatenated values to be put into dataset.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSDataSet

...

- JSDataSet with the data.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// converts a foundset pks to a dataset
var dataset = databaseManager.convertToDataSet(foundset);
// converts a foundset to a dataset
//var dataset = databaseManager.convertToDataSet(foundset,['product_id','product_name']);
// converts an object array to a dataset
//var dataset = databaseManager.convertToDataSet(files,['name','path']);
// converts an array to a dataset
//var dataset = databaseManager.convertToDataSet(new Array(1,2,3,4,5,6));
// converts an string list to a dataset
//var dataset = databaseManager.convertToDataSet('4,5,6');

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcopyMatchingFields-Object_JSRecord
Table Row (tr)
idname
Table Cell (td)
copyMatchingFields
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
copyMatchingFields
Span
(source, destination)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Copies all matching non empty columns (if overwrite boolean is given all columns except pk/ident, if array then all columns except pk and array names).
The matching requires the properties and getter functions of the source to match those of the destination; for the getter functions,
the 'get' will be removed and the remaining name will be converted to lowercase before attempting to match.
Returns true if no error occurred.

NOTE: This function could be used to store a copy of records in an archive table. Use the getRecord() function to get the record as an object.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} source

...

- The source record or (java/javascript)object to be copied.
{JSRecord} destination

...

- The destination record to copy to.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- true if no errors happened.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

for( var i = 1 ; i <= foundset.getSize() ; i++ )
{
	var srcRecord = foundset.getRecord(i);
	var destRecord = otherfoundset.getRecord(i);
	if (srcRecord == null || destRecord == null) break;
	databaseManager.copyMatchingFields(srcRecord,destRecord,true)
}
//saves any outstanding changes to the dest foundset
databaseManager.saveData();

//copying from a MailMessage JavaScript object
//var _msg = plugins.mail.receiveMail(login, password, true, 0, null, properties);
//if (_msg != null)
//{
//	controller.newRecord();
//	var srcObject = _msg[0];
//	var destRecord = foundset.getSelectedRecord();
//	databaseManager.copyMatchingFields(srcObject, destRecord, true);
//	databaseManager.saveData();
//}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcopyMatchingFields-Object_JSRecord_Boolean
Table Row (tr)
idname
Table Cell (td)
copyMatchingFields
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
copyMatchingFields
Span
(source, destination, overwrite)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Copies all matching non empty columns (if overwrite boolean is given all columns except pk/ident, if array then all columns except pk and array names).
The matching requires the properties and getter functions of the source to match those of the destination; for the getter functions,
the 'get' will be removed and the remaining name will be converted to lowercase before attempting to match.
Returns true if no error occurred.

NOTE: This function could be used to store a copy of records in an archive table. Use the getRecord() function to get the record as an object.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} source

...

- The source record or (java/javascript)object to be copied.
{JSRecord} destination

...

- The destination record to copy to.
{Boolean} overwrite

...

- Boolean values to overwrite all values.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- true if no errors happened.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

for( var i = 1 ; i <= foundset.getSize() ; i++ )
{
	var srcRecord = foundset.getRecord(i);
	var destRecord = otherfoundset.getRecord(i);
	if (srcRecord == null || destRecord == null) break;
	databaseManager.copyMatchingFields(srcRecord,destRecord,true)
}
//saves any outstanding changes to the dest foundset
databaseManager.saveData();

//copying from a MailMessage JavaScript object
//var _msg = plugins.mail.receiveMail(login, password, true, 0, null, properties);
//if (_msg != null)
//{
//	controller.newRecord();
//	var srcObject = _msg[0];
//	var destRecord = foundset.getSelectedRecord();
//	databaseManager.copyMatchingFields(srcObject, destRecord, true);
//	databaseManager.saveData();
//}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcopyMatchingFields-Object_JSRecord_StringArray
Table Row (tr)
idname
Table Cell (td)
copyMatchingFields
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
copyMatchingFields
Span
(source, destination, names)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Copies all matching non empty columns (if overwrite boolean is given all columns except pk/ident, if array then all columns except pk and array names).
The matching requires the properties and getter functions of the source to match those of the destination; for the getter functions,
the 'get' will be removed and the remaining name will be converted to lowercase before attempting to match.
Returns true if no error occurred.

NOTE: This function could be used to store a copy of records in an archive table. Use the getRecord() function to get the record as an object.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} source

...

- The source record or (java/javascript)object to be copied.
{JSRecord} destination

...

- The destination record to copy to.
{String[]} names

...

- The property names that shouldn't be overriden.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- true if no errors happened.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

for( var i = 1 ; i <= foundset.getSize() ; i++ )
{
	var srcRecord = foundset.getRecord(i);
	var destRecord = otherfoundset.getRecord(i);
	if (srcRecord == null || destRecord == null) break;
	databaseManager.copyMatchingFields(srcRecord,destRecord,true)
}
//saves any outstanding changes to the dest foundset
databaseManager.saveData();

//copying from a MailMessage JavaScript object
//var _msg = plugins.mail.receiveMail(login, password, true, 0, null, properties);
//if (_msg != null)
//{
//	controller.newRecord();
//	var srcObject = _msg[0];
//	var destRecord = foundset.getSelectedRecord();
//	databaseManager.copyMatchingFields(srcObject, destRecord, true);
//	databaseManager.saveData();
//}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateDataSourceByQuery-String_QBSelect_Number
Table Row (tr)
idname
Table Cell (td)
createDataSourceByQuery
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
createDataSourceByQuery
Span
(name, query, max_returned_rows)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Performs a query and saves the result in a datasource.
Will throw an exception if anything went wrong when executing the query.
Column types in the datasource are inferred from the query result or can be explicitly specified.

Using this variation of createDataSourceByQuery any Tablefilter on the involved tables will be taken into account.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} name

...

- data source name
{QBSelect} query

...

- The query builder to be executed.
{Number} max_returned_rows

...

- The maximum number of rows returned by the query.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String

...

- datasource containing the results of the query or null if the parameters are wrong.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// select customer data for order 1234
/** @type {QBSelect<db:/example_data/customers>} */
var q = databaseManager.createSelect("db:/example_data/customers");
q.result.add(q.columns.address).add(q.columns.city).add(q.columns.country);
q.where.add(q.joins.customers_to_orders.columns.orderid.eq(1234));
var uri = databaseManager.createDataSourceByQuery('mydata', q, 999);

...

//var uri = databaseManager.createDataSourceByQuery('mydata', q, 999, [JSColumn.TEXT, JSColumn.TEXT, JSColumn.TEXT]);

...

// the uri can be used to create a form using solution model
var myForm = solutionModel.newForm('newForm', uri, 'myStyleName', false, 800, 600);
myForm.newTextField('city', 140, 20, 140,20);

// the uri can be used to acces a foundset directly
var fs = databaseManager.getFoundSet(uri);
fs.loadAllRecords();

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateDataSourceByQuery-String_QBSelect_Number_NumberArray
Table Row (tr)
idname
Table Cell (td)
createDataSourceByQuery
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
createDataSourceByQuery
Span
(name, query, max_returned_rows, types)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Performs a query and saves the result in a datasource.
Will throw an exception if anything went wrong when executing the query.
Column types in the datasource are inferred from the query result or can be explicitly specified.

Using this variation of createDataSourceByQuery any Tablefilter on the involved tables will be taken into account.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} name

...

- Data source name
{QBSelect} query

...

- The query builder to be executed.
{Number} max_returned_rows

...

- The maximum number of rows returned by the query.
{Number[]} types

...

- The column types
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String

...

- datasource containing the results of the query or null if the parameters are wrong.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// select customer data for order 1234
/** @type {QBSelect<db:/example_data/customers>} */
var q = databaseManager.createSelect("db:/example_data/customers");
q.result.add(q.columns.address).add(q.columns.city).add(q.columns.country);
q.where.add(q.joins.customers_to_orders.columns.orderid.eq(1234));
var uri = databaseManager.createDataSourceByQuery('mydata', q, 999);

...

//var uri = databaseManager.createDataSourceByQuery('mydata', q, 999, [JSColumn.TEXT, JSColumn.TEXT, JSColumn.TEXT]);

// the uri can be used to create a form using solution model
var myForm = solutionModel.newForm('newForm', uri, 'myStyleName', false, 800, 600);
myForm.newTextField('city', 140, 20, 140,20);

// the uri can be used to acces a foundset directly
var fs = databaseManager.getFoundSet(uri);
fs.loadAllRecords();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateDataSourceByQuery-String_QBSelect_Number_NumberArray_StringArray
Table Row (tr)
idname
Table Cell (td)
createDataSourceByQuery
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
createDataSourceByQuery
Span
(name, query, max_returned_rows, types, pkNames)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Performs a query and saves the result in a datasource.
Will throw an exception if anything went wrong when executing the query.
Column types in the datasource are inferred from the query result or can be explicitly specified.

Using this variation of createDataSourceByQuery any Tablefilter on the involved tables will be taken into account.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} name - Data source name
{QBSelect} query - The query builder to be executed.
{Number} max_returned_rows - The maximum number of rows returned by the query.
{Number[]} types - The column types
{String[]} pkNames - array of pk names, when null a hidden pk-column will be added
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String - datasource containing the results of the query or null if the parameters are wrong.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// select customer data for order 1234
/** @type {QBSelect<db:/example_data/customers>} */
var q = databaseManager.createSelect("db:/example_data/customers");
q.result.add(q.columns.customer_id).add(q.columns.city).add(q.columns.country);
q.where.add(q.joins.customers_to_orders.columns.orderid.eq(1234));
var uri = databaseManager.createDataSourceByQuery('mydata', q, 999, null, ['customer_id']);
//var uri = databaseManager.createDataSourceByQuery('mydata', q, 999, [JSColumn.TEXT, JSColumn.TEXT, JSColumn.TEXT], ['customer_id']);

// the uri can be used to create a form using solution model
var myForm = solutionModel.newForm('newForm', uri, 'myStyleName', false, 800, 600);
myForm.newTextField('city', 140, 20, 140,20);

// the uri can be used to acces a foundset directly
var fs = databaseManager.getFoundSet(uri);
fs.loadAllRecords();

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateDataSourceByQuery-String_String_String_ObjectArray_Number
Table Row (tr)
idname
Table Cell (td)
createDataSourceByQuery
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
createDataSourceByQuery
Span
(name, server_name, sql_query, arguments, max_returned_rows)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Performs a sql query on the specified server, saves the the result in a datasource.
Will throw an exception if anything went wrong when executing the query.
Column types in the datasource are inferred from the query result or can be explicitly specified.

Using this variation of createDataSourceByQuery any Tablefilter on the involved tables will be disregarded.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} name

...

- data source name
{String} server_name

...

- The name of the server where the query should be executed.
{String} sql_query

...

- The custom sql.
{Object[]} arguments

...

- Specified arguments or null if there are no arguments.
{Number} max_returned_rows

...

- The maximum number of rows returned by the query.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String

...

- datasource containing the results of the query or null if the parameters are wrong.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

var query = 'select address, city, country  from customers';
var uri = databaseManager.createDataSourceByQuery('mydata', 'example_data', query, null, 999);
//var uri = databaseManager.createDataSourceByQuery('mydata', 'example_data', query, null, 999, [JSColumn.TEXT, JSColumn.TEXT, JSColumn.TEXT]);

// the uri can be used to create a form using solution model
var myForm = solutionModel.newForm('newForm', uri, 'myStyleName', false, 800, 600)
myForm.newTextField('city', 140, 20, 140,20)

// the uri can be used to acces a foundset directly
var fs = databaseManager.getFoundSet(uri)
fs.loadAllRecords();

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateDataSourceByQuery-String_String_String_ObjectArray_Number_NumberArray
Table Row (tr)
idname
Table Cell (td)
createDataSourceByQuery
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
createDataSourceByQuery
Span
(name, server_name, sql_query, arguments, max_returned_rows, types)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Performs a sql query on the specified server, saves the the result in a datasource.
Will throw an exception if anything went wrong when executing the query.
Column types in the datasource are inferred from the query result or can be explicitly specified.

Using this variation of createDataSourceByQuery any Tablefilter on the involved tables will be disregarded.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} name

...

- data source name
{String} server_name

...

- The name of the server where the query should be executed.
{String} sql_query

...

- The custom sql.
{Object[]} arguments

...

- Specified arguments or null if there are no arguments.
{Number} max_returned_rows

...

- The maximum number of rows returned by the query.
{Number[]} types

...

- The column types
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String

...

- datasource containing the results of the query or null if the parameters are wrong.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var query = 'select address, city, country  from customers';
var uri = databaseManager.createDataSourceByQuery('mydata', 'example_data', query, null, 999);
//var uri = databaseManager.createDataSourceByQuery('mydata', 'example_data', query, null, 999, [JSColumn.TEXT, JSColumn.TEXT, JSColumn.TEXT]);

// the uri can be used to create a form using solution model
var myForm = solutionModel.newForm('newForm', uri, 'myStyleName', false, 800, 600)
myForm.newTextField('city', 140, 20, 140,20)

// the uri can be used to acces a foundset directly
var fs = databaseManager.getFoundSet(uri)
fs.loadAllRecords();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateDataSourceByQuery-String_String_String_ObjectArray_Number_NumberArray_StringArray
Table Row (tr)
idname
Table Cell (td)
createDataSourceByQuery
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
createDataSourceByQuery
Span
(name, server_name, sql_query, arguments, max_returned_rows, types, pkNames)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Performs a sql query on the specified server, saves the the result in a datasource.
Will throw an exception if anything went wrong when executing the query.
Column types in the datasource are inferred from the query result or can be explicitly specified.

Using this variation of createDataSourceByQuery any Tablefilter on the involved tables will be disregarded.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} name - data source name
{String} server_name - The name of the server where the query should be executed.
{String} sql_query - The custom sql.
{Object[]} arguments - Specified arguments or null if there are no arguments.
{Number} max_returned_rows - The maximum number of rows returned by the query.
{Number[]} types - The column types
{String[]} pkNames - array of pk names, when null a hidden pk-column will be added
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String - datasource containing the results of the query or null if the parameters are wrong.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var query = 'select customer_id, address, city, country  from customers';
var uri = databaseManager.createDataSourceByQuery('mydata', 'example_data', query, null, 999);
//var uri = databaseManager.createDataSourceByQuery('mydata', 'example_data', query, null, 999, [JSColumn.TEXT, JSColumn.TEXT, JSColumn.TEXT], ['customer_id']);

// the uri can be used to create a form using solution model
var myForm = solutionModel.newForm('newForm', uri, 'myStyleName', false, 800, 600)
myForm.newTextField('city', 140, 20, 140,20)

// the uri can be used to acces a foundset directly
var fs = databaseManager.getFoundSet(uri)
fs.loadAllRecords();

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateEmptyDataSet
Table Row (tr)
idname
Table Cell (td)
createEmptyDataSet
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSDataSet
Span
stylefont-weight: bold;
createEmptyDataSet
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns an empty dataset object.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSDataSet

...

- An empty JSDataSet with the initial sizes.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// gets an empty dataset with a specifed row and column count
var dataset = databaseManager.createEmptyDataSet(10,10)
// gets an empty dataset with a specifed row count and column array
var dataset2 = databaseManager.createEmptyDataSet(10,new Array ('a','b','c','d'))

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateEmptyDataSet-Number_Number
Table Row (tr)
idname
Table Cell (td)
createEmptyDataSet
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSDataSet
Span
stylefont-weight: bold;
createEmptyDataSet
Span
(rowCount, columnCount)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns an empty dataset object.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Number} rowCount

...

- The number of rows in the DataSet object.
{Number} columnCount

...

- Number of columns.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSDataSet

...

- An empty JSDataSet with the initial sizes.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// gets an empty dataset with a specifed row and column count
var dataset = databaseManager.createEmptyDataSet(10,10)
// gets an empty dataset with a specifed row count and column array
var dataset2 = databaseManager.createEmptyDataSet(10,new Array ('a','b','c','d'))

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateEmptyDataSet-Number_StringArray
Table Row (tr)
idname
Table Cell (td)
createEmptyDataSet
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSDataSet
Span
stylefont-weight: bold;
createEmptyDataSet
Span
(rowCount, columnNames)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns an empty dataset object.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Number} rowCount
{String[]} columnNames
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSDataSet

...

- An empty JSDataSet with the initial sizes.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// gets an empty dataset with a specifed row and column count
var dataset = databaseManager.createEmptyDataSet(10,10)
// gets an empty dataset with a specifed row count and column array
var dataset2 = databaseManager.createEmptyDataSet(10,new Array ('a','b','c','d'))

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateSelect-String
Table Row (tr)
idname
Table Cell (td)
createSelect
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBSelect
Span
stylefont-weight: bold;
createSelect
Span
(dataSource)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create a QueryBuilder object for a datasource.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} dataSource

...

- The data source to build a query for.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
QBSelect

...

- query builder
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

/** @type {QBSelect<db:/example_data/book_nodes>} */
var q = databaseManager.createSelect('db:/example_data/book_nodes')
q.result.addPk()
q.where.add(q.columns.label_text.not.isin(null))
databaseManager.getFoundSet('db:/example_data/book_nodes').loadRecords(q)

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
iddataSourceExists-
Table Row (tr)
idname
Table Cell (td)
dataSourceExists
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
dataSourceExists
Span
(datasource)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Check wether a data source exists. This function can be used for any type of data source (db-based, in-memory).
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
datasource
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- boolean exists
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

if (!databaseManager.dataSourceExists(dataSource))
{
   // does not exist
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetAutoSave
Table Row (tr)
idname
Table Cell (td)
getAutoSave
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
getAutoSave
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns true or false if autosave is enabled or disabled.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean

...

- true if autosave if enabled.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

//Set autosave, if false then no saves will happen by the ui (not including deletes!). Until you call saveData or setAutoSave(true)
//Rollbacks in mem the records that were edited and not yet saved. Best used in combination with autosave false.
databaseManager.setAutoSave(false)
//Now let users input data

//On save or cancel, when data has been entered:
if (cancel) databaseManager.rollbackEditedRecords()
databaseManager.setAutoSave(true)

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDataModelClonesFrom-String
Table Row (tr)
idname
Table Cell (td)
getDataModelClonesFrom
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String[]
Span
stylefont-weight: bold;
getDataModelClonesFrom
Span
(serverName)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Retrieves a list with names of all database servers that have property DataModelCloneFrom equal to the server name parameter.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} serverName
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String[]
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

var serverNames = databaseManager.getDataModelClonesFrom('myServerName');

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDataSetByQuery-QBSelect_Number
Table Row (tr)
idname
Table Cell (td)
getDataSetByQuery
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSDataSet
Span
stylefont-weight: bold;
getDataSetByQuery
Span
(query, max_returned_rows)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Performs a sql query with a query builder object.
Will throw an exception if anything did go wrong when executing the query.

Using this variation of getDataSetByQuery any Tablefilter on the involved tables will be taken into account.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{QBSelect} query

...

- QBSelect query.
{Number} max_returned_rows

...

- The maximum number of rows returned by the query.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSDataSet

...

- The JSDataSet containing the results of the query.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

// use the query froma foundset and add a condition
/** @type {QBSelect<db:/example_data/orders>} */
var q = foundset.getQuery()
q.where.add(q.joins.orders_to_order_details.columns.discount.eq(2))
var maxReturnedRows = 10;//useful to limit number of rows
var ds = databaseManager.getDataSetByQuery(q, maxReturnedRows);

// query: select PK from example.book_nodes where parent = 111 and(note_date is null or note_date > now)
/** @type {QBSelect<db:/example_data/book_nodes>} */
var query = databaseManager.createSelect('db:/example_data/book_nodes').result.addPk().root
query.where.add(query.columns.parent_id.eq(111))
	.add(query.or
	.add(query.columns.note_date.isNull)
	.add(query.columns.note_date.gt(new Date())))
databaseManager.getDataSetByQuery(q, max_returned_rows)

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDataSetByQuery-String_String_ObjectArray_Number
Table Row (tr)
idname
Table Cell (td)
getDataSetByQuery
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSDataSet
Span
stylefont-weight: bold;
getDataSetByQuery
Span
(server_name, sql_query, arguments, max_returned_rows)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Performs a sql query on the specified server, returns the result in a dataset.
Will throw an exception if anything did go wrong when executing the query.

Using this variation of getDataSetByQuery any Tablefilter on the involved tables will be disregarded.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} server_name

...

- The name of the server where the query should be executed.
{String} sql_query

...

- The custom sql.
{Object[]} arguments

...

- Specified arguments or null if there are no arguments.
{Number} max_returned_rows

...

- The maximum number of rows returned by the query.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSDataSet

...

- The JSDataSet containing the results of the query.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

//finds duplicate records in a specified foundset
var vQuery =" SELECT companiesid from companies where company_name IN (SELECT company_name from companies group bycompany_name having count(company_name)>1 )";
var vDataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), vQuery, null, 1000);
controller.loadRecords(vDataset);

var maxReturnedRows = 10;//useful to limit number of rows
var query = 'select c1,c2,c3 from test_table where start_date = ?';//do not use '.' or special chars in names or aliases if you want to access data by name
var args = new Array();
args[0] = order_date //or  new Date()
var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), query, args, maxReturnedRows);

// place in label:

...

// elements.myLabel.text = '<html>'+dataset.getAsHTML()+'</html>';

//example to calc a strange total
global_total = 0;
for( var i = 1 ; i <= dataset.getMaxRowIndex() ; i++ )
{
	dataset.rowIndex = i;
	global_total = global_total + dataset.c1 + dataset.getValue(i,3);
}
//example to assign to dataprovider
//employee_salary = dataset.getValue(row,column)

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDataSource-String_String
Table Row (tr)
idname
Table Cell (td)
getDataSource
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getDataSource
Span
(serverName, tableName)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the datasource corresponding to the given server/table.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} serverName

...

- The name of the table's server.
{String} tableName

...

- The table's name.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String

...

- The datasource of the given table/server.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

var datasource = databaseManager.getDataSource('example_data', 'categories');

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDataSourceServerName-String
Table Row (tr)
idname
Table Cell (td)
getDataSourceServerName
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getDataSourceServerName
Span
(dataSource)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the server name from the datasource, or null if not a database datasource.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} dataSource

...

- The datasource string to get the server name from.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String

...

- The servername of the datasource.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

var servername = databaseManager.getDataSourceServerName(datasource);

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDataSourceTableName-String
Table Row (tr)
idname
Table Cell (td)
getDataSourceTableName
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getDataSourceTableName
Span
(dataSource)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the table name from the datasource, or null if not a database datasource.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} dataSource

...

- The datasource string to get the tablename from.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String

...

- The tablename of the datasource.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

var tablename = databaseManager.getDataSourceTableName(datasource);

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDatabaseProductName-String
Table Row (tr)
idname
Table Cell (td)
getDatabaseProductName
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getDatabaseProductName
Span
(serverName)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Returns the database product name as supplied by the driver for a server.

NOTE: For more detail on named server connections, see the chapter on Database Connections, beginning with the Introduction to database connections in the Servoy Developer User's Guide.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} serverName

...

- The specified name of the database server connection.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String

...

- A database product name.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

var databaseProductName = databaseManager.getDatabaseProductName(servername)

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetEditedRecords
Table Row (tr)
idname
Table Cell (td)
getEditedRecords
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSRecord[]
Span
stylefont-weight: bold;
getEditedRecords
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Returns an array of edited records with outstanding (unsaved) data.

NOTE: To return a dataset of outstanding (unsaved) edited data for each record, see JSRecord.getChangedData();
NOTE2: The fields focus may be lost in user interface in order to determine the edits.

Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSRecord[]

...

- Array of outstanding/unsaved JSRecords.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

...

//This method can be used to loop through all outstanding changes,
//the application.output line contains all the changed data, their tablename and primary key
var editr = databaseManager.getEditedRecords()
for (x=0;x<editr.length;x++)
{
	var ds = editr[x].getChangedData();
	var jstable = databaseManager.getTable(editr[x]);
	var tableSQLName = jstable.getSQLName();
	var pkrec = jstable.getRowIdentifierColumnNames().join(',');
	var pkvals = new Array();
	for (var j = 0; j < jstable.getRowIdentifierColumnNames().length; j++)
	{
		pkvals[j] = editr[x][jstable.getRowIdentifierColumnNames()[j]];
	}
	application.output('Table: '+tableSQLName +', PKs: '+ pkvals.join(',') +' ('+pkrec +')');
	// Get a dataset with outstanding changes on a record
	for( var i = 1 ; i <= ds.getMaxRowIndex() ; i++ )
	{
		application.output('Column: '+ ds.getValue(i,1) +', oldValue: '+ ds.getValue(i,2) +', newValue: '+ ds.getValue(i,3));
	}
}
//in most cases you will want to set autoSave back on now
databaseManager.setAutoSave(true);

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetEditedRecords-JSFoundSet
Table Row (tr)
idname
Table Cell (td)
getEditedRecords
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSRecord[]
Span
stylefont-weight: bold;
getEditedRecords
Span
(foundset)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Returns an array of edited records with outstanding (unsaved) data.

NOTE: To return a dataset of outstanding (unsaved) edited data for each record, see JSRecord.getChangedData();
NOTE2: The fields focus may be lost in user interface in order to determine the edits.

Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{JSFoundSet} foundset

...