servoy sReturnTypes2100%height: 30px;2Return TypessWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKsWordListBLOCKservoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientsWordListMobileClientservoy sSummary12%30%58%height: 30px;3Property SummaryEnable/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.servoy sSummary12%30%58%height: 30px;3Methods SummaryRequest lock(s) for a foundset, can be a normal or related foundset.Request lock(s) for a foundset, can be a normal or related foundset.Adds a filter to all the foundsets based on a table.Adds a filter to all the foundsets based on a table.Adds a filter to all the foundsets based on a table.Adds a filter to all the foundsets based on a table.voidAdd tracking info used in the log table.Returns true if a transaction is committed; rollback if commit fails.Returns true if a transaction is committed; rollback if commit fails.Returns true if a transaction is committed; rollback if commit fails.Creates a foundset that combines all the records of the specified one-to-many relation seen from the given parent/primary foundset.Creates a foundset that combines all the records of the specified one-to-many relation seen from the given parent/primary foundset.Converts the argument to a JSDataSet, possible use in controller.Converts the argument to a JSDataSet, possible use in controller.Converts the argument to a JSDataSet, possible use in controller.Converts the argument to a JSDataSet, possible use in controller.Converts the argument to a JSDataSet, possible use in controller.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).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).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).Performs a query and saves the result in a datasource.Performs a query and saves the result in a datasource.Performs a query and saves the result in a datasource.Performs a query and saves the result in a datasource.Performs a sql query on the specified server, saves the the result in a datasource.Performs a sql query on the specified server, saves the the result in a datasource.Performs a sql query on the specified server, saves the the result in a datasource.Returns an empty dataset object.Returns an empty dataset object.Returns an empty dataset object.Create a QueryBuilder object for a datasource.Create a QueryBuilder object for a datasource with given table alias.Check wether a data source exists.Returns true or false if autosave is enabled or disabled.Retrieves a list with names of all database servers that have property DataModelCloneFrom equal to the server name parameter.Performs a sql query with a query builder object.Performs a sql query with a query builder object.Performs a sql query on the specified server, returns the result in a dataset.Returns the datasource corresponding to the given server/table.Returns the server name from the datasource, or null if not a database datasource.Returns the table name from the datasource, or null if not a database datasource.Returns the database product name as supplied by the driver for a server.Returns an array of edited records with outstanding (unsaved) data.Returns an array of edited records with outstanding (unsaved) data.Returns an array of records that fail after a save.Returns an array of records that fail after a save.Returns a foundset object for a specified pk query.Returns a foundset object for a specified datasource or server and tablename.Returns a foundset object for a specified datasource or server and tablename.Returns the total number of records in a foundset.Returns a JSFoundsetUpdater object that can be used to update all or a specific number of rows in the specified foundset.Gets the next sequence for a column which has a sequence defined in its column dataprovider properties.Returns the internal SQL which defines the specified (related)foundset.Returns the internal SQL which defines the specified (related)foundset.Returns the internal SQL parameters, as an array, that are used to define the specified (related)foundset.Returns the internal SQL parameters, as an array, that are used to define the specified (related)foundset.Returns an array with all the server names used in the solution.Returns the JSTable object from which more info can be obtained (like columns).Returns the JSTable object from which more info can be obtained (like columns).Returns the JSTable object from which more info can be obtained (like columns).Returns the JSTable object from which more info can be obtained (like columns).Returns the total number of records(rows) in a table.Returns a two dimensional array object containing the table filter information currently applied to the servers tables.Returns a two dimensional array object containing the table filter information currently applied to the servers tables.Returns an array of all table names for a specified server.Returns an array of all view names for a specified server.Returns true if the current client has any or the specified lock(s) acquired.Returns true if the current client has any or the specified lock(s) acquired.Returns true if the argument (foundSet / record) has at least one row that was not yet saved in the database.Returns true if the argument (foundSet / record) has at least one row that was not yet saved in the database.Returns true if the specified foundset, on a specific index or in any of its records, or the specified record has changes.Returns true if the specified foundset, on a specific index or in any of its records, or the specified record has changes.Returns true if the (related)foundset exists and has records.Returns true if the (related)foundset exists and has records.Returns true if there is an transaction active for this client.Merge records from the same foundset, updates entire datamodel (via foreign type on columns) with destination record pk, deletes source record.Merge records from the same foundset, updates entire datamodel (via foreign type on columns) with destination record pk, deletes source record.voidCan be used to recalculate a specified record or all rows in the specified foundset.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.Release all current locks the client has (optionally limited to named locks).Release all current locks the client has (optionally limited to named locks).Removes a previously defined table filter.voidReverts outstanding (not saved) in memory changes from edited records.voidReverts outstanding (not saved) in memory changes from edited records.voidRollback a transaction started by databaseManager.voidRollback a transaction started by databaseManager.voidRollback a transaction started by databaseManager.Saves all outstanding (unsaved) data and exits the current record.Saves all outstanding (unsaved) data and exits the current record.Saves all outstanding (unsaved) data and exits the current record.Set autosave, if false then no saves will happen by the ui (not including deletes!).voidTurnoff the initial form foundset record loading, set this in the solution open method.voidStart a database transaction.Switches a named server to another named server with the same datamodel (recommended to be used in an onOpen method for a solution).propertyservoy sDetail2100%height:30px2Property DetailsnullColumnValidatorEnabledname
nullColumnValidatorEnabled
dessIndentEnable/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.ret
dessIndentRequest 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.prs
Parameters
sIndentfoundsetThe JSFoundset to get the lock forrecordIndexThe record index which should be locked.ret
dessIndentRequest 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.prs
Parameters
sIndentfoundsetThe JSFoundset to get the lock forrecordIndexThe record index which should be locked.lockNameThe name of the lock.ret
dessIndentAdds 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.prs
Parameters
sIndentdatasourceThe datasourcedataproviderA specified dataprovider column name.operatorOne of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null).valueThe specified filter value.ret
dessIndentAdds 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.prs
Parameters
sIndentdatasourceThe datasourcedataproviderA specified dataprovider column name.operatorOne of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null).valueThe specified filter value.filterNameThe specified name of the database table filter.ret
dessIndentAdds 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.prs
Parameters
sIndentserverNameThe name of the database server connection for the specified table name.tableNameThe name of the specified table.dataproviderA specified dataprovider column name.operatorOne of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null).valueThe specified filter value.ret
dessIndentAdds 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.prs
Parameters
sIndentserverNameThe name of the database server connection for the specified table name.tableNameThe name of the specified table.dataproviderA specified dataprovider column name.operatorOne of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null).valueThe specified filter value.filterNameThe specified name of the database table filter.ret
dessIndentAdd 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'prs
Parameters
sIndentcolumnNameThe name of the column in the log table, used for tracking infovalueThe value to be set when inserting a new row in the log table, for the 'columnName' columnret
dessIndentReturns true if a transaction is committed; rollback if commit fails.prs
Parameters
sIndentsaveFirstsave edited records to the database first (default true)revertSavedRecordsif 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)ret
dessIndentCreates 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.prs
Parameters
sIndentfoundsetThe JSFoundset to convert.relatedcan be a one-to-many relation object or the name of a one-to-many relationret
dessIndentCreates 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.prs
Parameters
sIndentfoundsetThe JSFoundset to convert.relatedthe name of a one-to-many relationret
dessIndentConverts 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.prs
dessIndentConverts 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.prs
Parameters
sIndentfoundsetThe foundset to be converted.dataproviderNamesArray with column names.ret
dessIndentConverts 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.prs
dessIndentConverts 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.prs
dessIndentConverts 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.prs
Parameters
sIndentidsConcatenated values to be put into dataset.ret
dessIndentCopies 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. Before trying this example, please make sure that the foundsets have some records loaded:prs
Parameters
sIndentsourceThe source record or (java/javascript)object to be copied.destinationThe destination record to copy to.ret
dessIndentCopies 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. Before trying this example, please make sure that the foundsets have some records loaded:prs
Parameters
sIndentsourceThe source record or (java/javascript)object to be copied.destinationThe destination record to copy to.overwriteBoolean values to overwrite all values. If overwrite is false/not provided, then the non empty values are not overwritten in the destination record.ret
dessIndentCopies 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. Before trying this example, please make sure that the foundsets have some records loaded:prs
Parameters
sIndentsourceThe source record or (java/javascript)object to be copied.destinationThe destination record to copy to.namesThe property names that shouldn't be overriden.ret
dessIndentPerforms 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. A datasource can be reused if the data has the same signature (column names and types). A new createDataSourceByQuery() call will clear the datasource contents from a previous call and insert the current data.prs
Parameters
sIndentnameData source namequeryThe query builder to be executed.useTableFiltersuse table filters (default true).max_returned_rowsThe maximum number of rows returned by the query.typesThe column types, when null the types are inferred from the query.pkNamesarray of pk names, when null a hidden pk-column will be addedret
dessIndentPerforms 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. A datasource can be reused if the data has the same signature (column names and types). A new createDataSourceByQuery() call will clear the datasource contents from a previous call and insert the current data.prs
Parameters
sIndentnamedata source namequeryThe query builder to be executed.max_returned_rowsThe maximum number of rows returned by the query.ret
dessIndentPerforms 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. A datasource can be reused if the data has the same signature (column names and types). A new createDataSourceByQuery() call will clear the datasource contents from a previous call and insert the current data.prs
Parameters
sIndentnameData source namequeryThe query builder to be executed.max_returned_rowsThe maximum number of rows returned by the query.typesThe column typesret
dessIndentPerforms 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. A datasource can be reused if the data has the same signature (column names and types). A new createDataSourceByQuery() call will clear the datasource contents from a previous call and insert the current data.prs
Parameters
sIndentnameData source namequeryThe query builder to be executed.max_returned_rowsThe maximum number of rows returned by the query.typesThe column typespkNamesarray of pk names, when null a hidden pk-column will be addedret
dessIndentPerforms 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. A datasource can be reused if the data has the same signature (column names and types). A new createDataSourceByQuery() call will clear the datasource contents from a previous call and insert the current data.prs
Parameters
sIndentnamedata source nameserver_nameThe name of the server where the query should be executed.sql_queryThe custom sql.argumentsSpecified arguments or null if there are no arguments.max_returned_rowsThe maximum number of rows returned by the query.ret
dessIndentPerforms 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. A datasource can be reused if the data has the same signature (column names and types). A new createDataSourceByQuery() call will clear the datasource contents from a previous call and insert the current data.prs
Parameters
sIndentnamedata source nameserver_nameThe name of the server where the query should be executed.sql_queryThe custom sql.argumentsSpecified arguments or null if there are no arguments.max_returned_rowsThe maximum number of rows returned by the query.typesThe column typesret
dessIndentPerforms 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. A datasource can be reused if the data has the same signature (column names and types). A new createDataSourceByQuery() call will clear the datasource contents from a previous call and insert the current data.prs
Parameters
sIndentnamedata source nameserver_nameThe name of the server where the query should be executed.sql_queryThe custom sql.argumentsSpecified arguments or null if there are no arguments.max_returned_rowsThe maximum number of rows returned by the query.typesThe column typespkNamesarray of pk names, when null a hidden pk-column will be addedret
dessIndentCreate a QueryBuilder object for a datasource with given table alias. The alias can be used inside custom queries to bind to the outer table.prs
Parameters
sIndentdataSourceThe data source to build a query for.tableAliasThe alias for the main table.ret
dessIndentPerforms 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.prs
Parameters
sIndentqueryQBSelect query.max_returned_rowsThe maximum number of rows returned by the query.ret
dessIndentPerforms 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.prs
Parameters
sIndentserver_nameThe name of the server where the query should be executed.sql_queryThe custom sql.argumentsSpecified arguments or null if there are no arguments.max_returned_rowsThe maximum number of rows returned by the query.ret
dessIndentReturns 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.prs
Parameters
sIndentserverNameThe specified name of the database server connection.ret
dessIndentReturns an array of edited records with outstanding (unsaved) data. This is different form JSRecord.isEditing() because this call actually checks if there are changes between the current record data and the stored data in the database. If there are no changes then the record is removed from the edited records list (so after this call JSRecord.isEditing() can return false when it returned true just before this call) 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.ret
dessIndentReturns 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.prs
Parameters
sIndentfoundsetreturn edited records in the foundset only.ret
dessIndentReturns a foundset object for a specified datasource or server and tablename. Alternative method: datasources.db.server_name.table_name.getFoundSet() or datasources.mem['ds'].getFoundSet()prs
Parameters
sIndentdataSourceThe datasource to get a JSFoundset for.ret
dessIndentGets the next sequence for a column which has a sequence defined in its column dataprovider properties. NOTE: For more infomation on configuring the sequence for a column, see the section Auto enter options for a column from the Dataproviders chapter in the Servoy Developer User's Guide.prs
Parameters
sIndentdataSourceThe datasource that points to the table which has the column with the sequence, or the name of the server where the table can be found. If the name of the server is specified, then a second optional parameter specifying the name of the table must be used. If the datasource is specified, then the name of the table is not needed as the second argument.columnNameThe name of the column that has a sequence defined in its properties.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRow getSQLname
getSQL(foundsetOrQBSelect)
dessIndentReturns the internal SQL which defines the specified (related)foundset. Table filters are on by default. Make sure to set the applicable filters when the sql is used in a loadRecords() call.prs
Parameters
sIndentfoundsetOrQBSelectThe JSFoundset or QBSelect to get the sql for.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRow getSQLname
getSQL(foundsetOrQBSelect, includeFilters)
dessIndentReturns the internal SQL which defines the specified (related)foundset. Optionally, the foundset and table filter params can be excluded in the sql (includeFilters=false). Make sure to set the applicable filters when the sql is used in a loadRecords() call. When the founset is in find mode, the find conditions are included in the resulting query.prs
Parameters
sIndentfoundsetOrQBSelectThe JSFoundset or QBSelect to get the sql for.includeFiltersinclude the foundset and table filters.ret
dessIndentReturns the internal SQL parameters, as an array, that are used to define the specified (related)foundset. Parameters for the filters are included.prs
Parameters
sIndentfoundsetOrQBSelectThe JSFoundset or QBSelect to get the sql parameters for.ret
dessIndentReturns the internal SQL parameters, as an array, that are used to define the specified (related)foundset. When the founset is in find mode, the arguments for the find conditions are included in the result.prs
Parameters
sIndentfoundsetOrQBSelectThe JSFoundset or QBSelect to get the sql parameters for.includeFiltersinclude the parameters for the filters.ret
dessIndentReturns an array with all the server names used in the solution. 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.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRow getTablename
getTable(foundset)
dessIndentReturns the JSTable object from which more info can be obtained (like columns). The parameter can be a JSFoundset,JSRecord,datasource string or server/tablename combination.prs
Parameters
sIndentfoundsetThe foundset where the JSTable can be get from.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRow getTablename
getTable(record)
dessIndentReturns the JSTable object from which more info can be obtained (like columns). The parameter can be a JSFoundset,JSRecord,datasource string or server/tablename combination.prs
Parameters
sIndentrecordThe record where the table can be get from.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRow getTablename
getTable(dataSource)
dessIndentReturns the JSTable object from which more info can be obtained (like columns). The parameter can be a JSFoundset,JSRecord,datasource string or server/tablename combination.prs
Parameters
sIndentdataSourceThe datasource where the table can be get from.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRow getTablename
getTable(serverName, tableName)
dessIndentReturns the JSTable object from which more info can be obtained (like columns). The parameter can be a JSFoundset,JSRecord,datasource string or server/tablename combination.prs
dessIndentReturns a two dimensional array object containing the table filter information currently applied to the servers tables. The "columns" of a row from this array are: tablename,dataprovider,operator,value,tablefilernameprs
Parameters
sIndentserverNameThe name of the database server connection.ret
dessIndentReturns a two dimensional array object containing the table filter information currently applied to the servers tables. The "columns" of a row from this array are: tablename,dataprovider,operator,value,tablefilernameprs
Parameters
sIndentserverNameThe name of the database server connection.filterNameThe filter name for which to get the array.ret
dessIndentReturns true if the specified foundset, on a specific index or in any of its records, or the specified record has changes. NOTE: The fields focus may be lost in user interface in order to determine the edits.prs
Parameters
sIndentfoundsetThe JSFoundset to test if it has changes.ret
dessIndentReturns true if the specified foundset, on a specific index or in any of its records, or the specified record has changes. NOTE: The fields focus may be lost in user interface in order to determine the edits.prs
Parameters
sIndentfoundsetThe JSFoundset to test if it has changes.indexThe record index in the foundset to test (not specified means has the foundset any changed records)ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRow hasRecordsname
hasRecords(foundset)
dessIndentReturns true if the (related)foundset exists and has records.prs
dessIndentMerge records from the same foundset, updates entire datamodel (via foreign type on columns) with destination record pk, deletes source record. Do use a transaction! This function is very handy in situations where duplicate data exists. It allows you to merge the two records and move all related records in one go. Say the source_record is "Ikea" and the combined_destination_record is "IKEA", the "Ikea" record is deleted and all records related to it (think of contacts and orders, for instance) will be related to the "IKEA" record. The function takes an optional array of column names. If provided, the data in the named columns will be copied from source_record to combined_destination_record. Note that it is essential for both records to originate from the same foundset, as shown in the sample code.prs
Parameters
sIndentsourceRecordThe source JSRecord to copy from.combinedDestinationRecordThe target/destination JSRecord to copy into.ret
dessIndentMerge records from the same foundset, updates entire datamodel (via foreign type on columns) with destination record pk, deletes source record. Do use a transaction! This function is very handy in situations where duplicate data exists. It allows you to merge the two records and move all related records in one go. Say the source_record is "Ikea" and the combined_destination_record is "IKEA", the "Ikea" record is deleted and all records related to it (think of contacts and orders, for instance) will be related to the "IKEA" record. The function takes an optional array of column names. If provided, the data in the named columns will be copied from source_record to combined_destination_record. Note that it is essential for both records to originate from the same foundset, as shown in the sample code.prs
Parameters
sIndentsourceRecordThe source JSRecord to copy from.combinedDestinationRecordThe target/destination JSRecord to copy into.columnNamesThe column names array that should be copied.ret
dessIndentCan be used to recalculate a specified record or all rows in the specified foundset. May be necessary when data is changed from outside of servoy, or when there is data changed inside servoy but records with calculations depending on that data where not loaded so not updated and you need to update the stored calculation values because you are depending on that with queries or aggregates.prs
Parameters
sIndentfoundsetOrRecordJSFoundset or JSRecord to recalculate.ret
dessIndentFlushes 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. Used where a program external to Servoy has modified the database record. Record index of -1 will refresh all records in the foundset and 0 the selected record.prs
Parameters
sIndentfoundsetThe JSFoundset to refreshindexThe index of the JSRecord that must be refreshed (or -1 for all).ret
dessIndentReverts outstanding (not saved) in memory changes from edited records. Can specify a record or foundset as parameter to rollback. Best used in combination with the function databaseManager.setAutoSave() This does not include deletes, they do not honor the autosafe false flag so they cant be rollbacked by this call.ret
dessIndentReverts outstanding (not saved) in memory changes from edited records. Can specify a record or foundset as parameter to rollback. Best used in combination with the function databaseManager.setAutoSave() This does not include deletes, they do not honor the autosafe false flag so they cant be rollbacked by this call.prs
dessIndentRollback a transaction started by databaseManager.startTransaction(). Note that when autosave is false, revertEditedRecords() will not handle deleted records, while rollbackTransaction() does. Also, rollbackEditedRecords() is called before rolling back the transaction see rollbackTransaction(boolean) to controll that behavior and saved records within the transactions are restored to the database values, so user input is lost, to control this see rollbackTransaction(boolean,boolean)ret
dessIndentRollback a transaction started by databaseManager.startTransaction(). Note that when autosave is false, revertEditedRecords() will not handle deleted records, while rollbackTransaction() does. Also, saved records within the transactions are restored to the database values, so user input is lost, to controll this see rollbackTransaction(boolean,boolean)prs
Parameters
sIndentrollbackEditedcall rollbackEditedRecords() before rolling back the transactionret
dessIndentRollback a transaction started by databaseManager.startTransaction(). Note that when autosave is false, revertEditedRecords() will not handle deleted records, while rollbackTransaction() does.prs
Parameters
sIndentrollbackEditedcall rollbackEditedRecords() before rolling back the transactionrevertSavedRecordsif false then all records in the transaction do keep the user input and are back in the edited records list. Note that if the pks of such a record are no longer used by it's foundset (find/search or load by query or ...) it will just be rolled-back as it can't be put in editing records list.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRow saveDataname
saveData()
dessIndentSaves all outstanding (unsaved) data and exits the current record. Optionally, by specifying a record or foundset, can save a single record or all records from foundset instead of all the data. NOTE: The fields focus may be lost in user interface in order to determine the edits. SaveData called from table events (like afterRecordInsert) is only partially supported depeding on how first saveData (that triggers the event) is called. If first saveData is called with no arguments, all saveData from table events are returning immediatelly with true value and records will be saved as part of first save. If first saveData is called with record(s) as arguments, saveData from table event will try to save record(s) from arguments that are different than those in first call. SaveData with no arguments inside table events will always return true without saving anything.ret
dessIndentSaves all outstanding (unsaved) data and exits the current record. Optionally, by specifying a record or foundset, can save a single record or all records from foundset instead of all the data. NOTE: The fields focus may be lost in user interface in order to determine the edits. SaveData called from table events (like afterRecordInsert) is only partially supported depeding on how first saveData (that triggers the event) is called. If first saveData is called with no arguments, all saveData from table events are returning immediatelly with true value and records will be saved as part of first save. If first saveData is called with record(s) as arguments, saveData from table event will try to save record(s) from arguments that are different than those in first call. SaveData with no arguments inside table events will always return true without saving anything.prs
Parameters
sIndentfoundsetThe JSFoundset to save.ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRow saveDataname
saveData(record)
dessIndentSaves all outstanding (unsaved) data and exits the current record. Optionally, by specifying a record or foundset, can save a single record or all records from foundset instead of all the data. NOTE: The fields focus may be lost in user interface in order to determine the edits. SaveData called from table events (like afterRecordInsert) is only partially supported depeding on how first saveData (that triggers the event) is called. If first saveData is called with no arguments, all saveData from table events are returning immediatelly with true value and records will be saved as part of first save. If first saveData is called with record(s) as arguments, saveData from table event will try to save record(s) from arguments that are different than those in first call. SaveData with no arguments inside table events will always return true without saving anything.prs
dessIndentSet autosave, if false then no saves will happen by the ui (not including deletes!). Until you call databaseManager.saveData() or setAutoSave(true) If you also want to be able to rollback deletes then you have to use databaseManager.startTransaction(). Because even if autosave is false deletes of records will be done.prs
Parameters
sIndentautoSaveBoolean to enable or disable autosave.ret
dessIndentTurnoff the initial form foundset record loading, set this in the solution open method. Simular to calling foundset.clear() in the form's onload event. NOTE: When the foundset record loading is turned off, controller.find or controller.loadAllRecords must be called to display the recordsret
dessIndentStart a database transaction. If you want to avoid round trips to the server or avoid the posibility of blocking other clients because of your pending changes, you can use databaseManager.setAutoSave(false/true) and databaseManager.rollbackEditedRecords(). startTransaction, commit/rollbackTransacton() does support rollbacking of record deletes which autoSave = false doesnt support.ret
dessIndentSwitches a named server to another named server with the same datamodel (recommended to be used in an onOpen method for a solution). return true if successful. Note that this only works if source and destination server are of the same database type.prs
Parameters
sIndentsourceNameThe name of the source database server connectiondestinationNameThe name of the destination database server connection.ret