Docs
ServoyCloudSupportSamplesOpen SourceCommunity
  • Home
  • GUIDES
    • Platform Overview
    • Get Servoy
    • Get Started
      • Chapter 0
      • Chapter 1
      • Chapter 2
      • Chapter 3
      • Chapter 4
      • Chapter 5
    • Get Help
      • SuLA Instructions
      • SuLA Terms
    • Develop
      • Application Design
        • Forms
          • Layout Management
            • Simple Layout
            • Fully Responsive
              • Bootstrap 12-Grid
              • Flexbox
              • Custom Div
              • Collapsible Container
              • Simple Collapsible
              • Center Container
              • Inline Group Container
            • Abstract Form
          • Form Containers
            • Form Container
            • Tab Panel
            • Split Pane
            • Collapse
            • Accordion Panel
            • Form Component
            • List Form Component
          • Form Inheritance
          • Form Components
        • UI Components
          • Buttons and Text
            • Badge
            • Button
            • Data Label
            • Dropdown
            • Image
            • Label
          • Grids
            • Data Grid
            • Power Grid
            • Table
          • Input Controls
            • Calendar
            • Calendar Inline
            • Checkbox
            • Choice Group
            • Combobox
            • Group Buttons
            • Html Area
            • Input Group
            • Rating
            • Slider
            • Switch
            • Spinner
            • TextArea
            • Textbox
            • TextBoxGroup
            • Type Ahead
            • select2tokenizer
          • Media
            • Carousel
            • Embedded YouTube
            • File upload
            • Image label
            • Lightbox Gallery
            • MultiFile Upload
            • PDF JS Viewer
            • PDF Viewer
          • Mobile
            • Native Data List
            • Native Select
          • Navigation
            • Breadcrumbs
            • Navbar
            • sidenav
          • Visualization
            • DBTreeview
            • Progress Bar
            • Treeview
            • ChartJS
              • Data Labels Plugin
              • Funnel Chart
              • OutLabels Plugin
              • TreeMap
          • Specialized Components
            • Smart Document Editor
            • Servoy PDF Viewer
            • Fullcalendar Component
              • Fullcalendar
              • Fullcalendar Events
              • Migrating calendar from Smart and Web client to NG client
            • Fullcalendar Component 2
            • Canvas
            • Google Charts
            • Google Maps
            • svySignature
            • svywebcam
        • Styling and Themes
          • Default Theme Properties
          • CSS / LESS
          • Component Variants
          • Font Icons
        • Data Modeling
          • Databases
            • Tables
              • Columns
              • Calculations
              • Aggregations
              • Methods
              • Events / Triggers
              • Table security
            • Views
            • Procedures
          • Relations
          • Value Lists
          • Menus
          • In-Memory Databases
          • View Datasource
        • Modular Design
      • Programming Guide
        • Scripting the UI
          • Scripting Forms
          • Interacting with Components
          • Navigation
          • Windows, Dialogs and Popups
          • Events Manager
        • Working with Data
          • Concepts
          • Loading
          • Sorting
          • Iterating
          • Searching
            • Find mode
            • Query Builder
            • SQL String
          • Filtering
          • Editing
          • Validation
        • Automation and Scheduling
          • Batch Processor
          • Headless API
          • Scheduler API
        • Creating REST APIs
        • Consuming Webservices
        • Working with Files
          • File Plugin Basics
          • Images
          • Excel
          • PDF
          • JSON
        • Browser Utilities
          • Notifications
            • Web Notifications (Toastr)
            • Web Notifications (Native)
            • Block UI
          • Session Management
          • Keyboard Utilities
          • NG Utils
        • Sending and Receiving Email
        • Servoy Jasper Reports
          • Input Type
          • Display Mode
          • Output format
          • Jaspe Reports Viewer
        • Extensions
          • Modules
            • svyPhonegap
              • First Use Guide
              • Barcode Scanner
              • Browser
              • Camera
              • File
              • Fingerprint
              • Location
              • Network Interface
              • Phonegap
              • Printer
              • Push Notifications
            • svyAPI
              • Getting Started
            • svyLookup
              • Custom Templates
              • API Documentation
              • svyLookup v1
                • API Documentation v1.0.0
                • Base Form svyLookupTable v1.0.0
                • Base Form AbstractLookup v1.0.0
            • svyNavigation
              • API Documentation
                • API svyNavigation
                • API svyNavigationHistory
                • API svyNavigationUX
            • svyPopupFilter
              • Simple Filter Pickers
              • Custom Templates
              • API Documentation
                • API svyToolbarFilter
                • API svyPopupFilter
              • API Documentation v1
                • API svyToolbarFilter v1
                • API svyPopupFilter v1
            • svySearch
            • svySecurity
              • Overview
              • Token-based Auth and SSO (NEW!)
              • API Documentation
              • Getting Started
              • Tenant replication
              • Security Management Console
                • Classic Security Management Console
              • svySecurityUX
              • svyProperties
              • API Doc svyProperties
            • svyUtils
              • Log Manager
              • Log Manager Appenders
              • Smart Doc Editor Utils
              • Custom Dialogs
              • Excel Utils
                • Full API Reference
              • Crypto Utils
      • Security
        • Authentication
        • Permissions
          • UI Permissions
          • Data Permissions
          • Runtime Permissions
        • Audit Logging
        • OAuth
        • JWT
      • Multi-Language Support
      • Mobile Development
        • Getting Started
        • Mobile Design
        • Native Mobile Integrations
        • Building a Native Binary for the App Store
      • Native Desktop Development
        • NGDesktop UI plugin
        • NGDesktop Utils
        • NGDesktop File Plugin
    • Deploy
      • WAR Deployment
      • Docker Deployment
      • Server Configuration
        • Server Settings
        • Server Plugins
        • Database Servers
          • Locks
          • Transactions
          • Oracle
          • SQLServer
        • Client Sessions
        • Batch Processors
        • License Management
        • Monitoring
          • Server Log
          • Browser Console Log
          • Websocket Log
          • Query Performance
          • Client Performance
          • Client Event Tracing
          • Monitoring Servoy with JMX
      • NGClient deployment
      • Troubleshooting
      • Other Topics
        • Security: Cross-site Scripting
        • Running in an iFrame
    • Extend
    • Contribute
  • Reference
    • Servoy Core
      • Object Model
        • Database Server
          • Table
            • Column
            • Calculation
            • Method
            • Aggregation
          • View
          • Procedure
        • Solution
          • Form
          • Form Component
          • Relation
          • Relation Item
          • Table Node
          • Value List
          • Menu
          • Menu item
          • In-Memory Data Source
          • View Foundset Data Source
          • Variable
          • Column Info
          • Media
          • Layout Container
          • Method
        • i18n Message Key
      • Developer API
        • Globals
        • Forms
          • RuntimeForm
            • controller
            • containers
              • RuntimeContainer
            • elements
              • Component
              • RuntimeAccordionPanel
              • RuntimeBean
              • RuntimeButton
              • RuntimeCalendar
              • RuntimeCheck
              • RuntimeCombobox
              • RuntimeComponent
              • RuntimeDataButton
              • RuntimeDataLabel
              • RuntimeGroup
              • RuntimeHtmlArea
              • RuntimeImageMedia
              • RuntimeInsetList
              • RuntimeLabel
              • RuntimeListBox
              • RuntimePassword
              • RuntimePortal
              • RuntimeRadio
              • RuntimeChecks
              • RuntimeRadios
              • RuntimeRectangle
              • RuntimeRtfArea
              • RuntimeSpinner
              • RuntimeSplitPane
              • RuntimeTabPanel
              • RuntimeTextArea
              • RuntimeTextField
              • RuntimeWebComponent
        • JS Lib
          • Array
          • BigInt
          • Boolean
          • Date
          • Function
          • IterableValue
          • Iterator
          • JSON
          • Map
          • Set
          • Math
          • Namespace
          • Number
          • Object
          • Promise
          • QName
          • RegExp
          • Special Operators
          • Statements
          • String
          • XML
          • XMLList
        • Application
          • APPLICATION_TYPES
          • CLIENTDESIGN
          • DRAGNDROP
          • ELEMENT_TYPES
          • LOGGINGLEVEL
          • NGCONSTANTS
          • UICONSTANTS
          • CSSPosition
          • JSDimension
          • JSDNDEvent
          • JSEvent
          • JSLogger
          • JSLogBuilder
          • JSPoint
          • JSUpload
          • JSWindow
          • JSBounds
          • Renderable
          • UUID
        • SolutionModel
          • ALIGNMENT
          • ANCHOR
          • BEVELTYPE
          • CURSOR
          • DEFAULTS
          • FONTSTYLE
          • MEDIAOPTION
          • PAGEORIENTATION
          • PRINTSLIDING
          • SCROLLBAR
          • TITLEJUSTIFICATION
          • TITLEPOSITION
          • UNITS
          • JSBean
          • JSButton
          • JSCalculation
          • JSComponent
          • JSDataSourceNode
          • JSField
          • JSForm
          • JSLabel
          • JSMedia
          • JSMethod
          • JSPart
          • JSPortal
          • JSRelation
          • JSRelationItem
          • JSStyle
          • JSTab
          • JSTabPanel
          • JSValueList
          • JSVariable
          • JSTitle
          • JSChecks
          • JSCombobox
          • JSHeader
          • JSInsetList
          • JSList
          • JSPassword
          • JSRadios
          • JSText
          • JSTextArea
          • JSWebComponent
          • JSLayoutContainer
        • Database Manager
          • QUERY_COLUMN_TYPES
          • SQL_ACTION_TYPES
          • JSColumn
          • JSDataSet
          • JSBaseRecord
          • JSBaseSqlRecord
          • JSBaseFoundset
          • JSBaseSQLFoundset
          • JSFoundSet
          • JSFoundSetUpdater
          • JSRecord
          • JSRecordMarker
          • JSRecordMarkers
          • JSTable
          • JSTableFilter
          • MenuFoundSet
          • MenuItemRecord
          • QBAggregate
          • QBAggregates
          • QBCase
          • QBCaseWhen
          • QBColumn
          • QBColumns
          • QBCondition
          • QBFunction
          • QBFunctions
          • QBGroupBy
          • QBJoin
          • QBJoins
          • QBLogicalCondition
          • QBParameter
          • QBParameters
          • QBPart
          • QBResult
          • QBSearchedCaseExpression
          • QBSelect
          • QBSort
          • QBSorts
          • QBTableClause
          • QBWhereCondition
          • ViewFoundSet
          • ViewRecord
        • Events Manager
          • EVENTS_AGGREGATION_TYPES
          • EventType
        • Menus
          • JSMenu
          • JSMenuItem
        • JSMenuDatasource
        • Utils
        • Client Utils
          • JSBlobLoaderBuilder
        • History
        • Security
        • i18n
        • ServoyException
          • DataException
        • JSUnit
        • Datasources
          • DBDataSource
          • DBDataSourceServer
          • JSConnectionDefinition
          • JSDataSource
          • MemDataSource
          • MenuDataSource
          • SPDataSource
          • SPDataSourceServer
          • ViewDataSource
        • JSViewDatasource
        • servoyDeveloper
        • enum
    • Extensions
      • UI Components
        • Buttons and Text
          • Badge
          • Button
          • Data Label
          • Drop Down
          • Image
          • Label
        • Form Containers
          • Accordion Panel
          • Collapse
          • Form Container
          • Form Component Container
          • List Form Component
          • Default Loading Indicator
          • Error Bean
          • Portal
          • Responsive Container
          • Servoy Default Navigator
          • Slider
          • Split Pane
          • TabPanel
        • Grids
          • Data Grid
          • Power Grid
          • Table
        • Input Controls
          • Calendar
          • Calendar Inline
          • Checkbox
          • Choice Group
          • Combobox
          • Floatinglabel Calendar
          • Floatinglabel Combobox
          • Floatinglabel Textarea
          • Floatinglabel Textbox
          • Floatinglabel Type Ahead
          • Group Buttons
          • Html Area
          • Input Group
          • Rating
          • Select2tokenizer
          • Slider
          • Spinner
          • Switch
          • TextArea
          • TextBox
          • TextBox Group
          • Type Ahead
        • Media
          • Carousel
          • Embedded YouTube
          • File upload
          • Image label
          • Lightbox Gallery
          • MultiFile Upload
          • PDF JS Viewer
          • PDF Viewer
        • Mobile
          • Native Data List
          • Native Select
        • Navigation
          • Breadcrumbs
          • Navbar
          • sidenav
        • SmartDocEditor
          • Smart Document Editor
        • Visualization
          • Canvas
          • Chart
          • Custom List
          • DBTreeview
          • Foundset List
          • Fullcalendar
          • Gauge
          • Google Maps
          • Kanban
          • Progress Bar
          • Treeview
      • Server Plugins
        • amortization
          • AmortizationCalculation
          • Polynomial
        • clientmanager
          • Broadcaster
          • JSClientInformation (cm)
        • excelxport
        • file
          • JSFile
          • JSProgressMonitor
        • headlessclient
          • JSClient
        • http
          • HTTP_STATUS
          • Cookie
          • DeleteRequest
          • GetRequest
          • HeadRequest
          • HttpClient
          • HttpClientConfig
          • OptionsRequest
          • PostRequest
          • PutRequest
          • Response
          • TraceRequest
          • PatchRequest
          • JSFileUpload
        • images
          • JSImage
        • jwt
          • Algorithm
          • Builder
          • JWTClaims
        • mail
          • Attachment
          • MailMessage
        • maintenance
          • JSClientInformation
          • JSColumnObject
          • JSServer
          • JSTableObject
        • mobileservice
          • OfflineDataDescription
        • oauth
          • ClientAuthentication
          • CustomApiBuilder
          • OAuthProviders
          • OAuthRequest
          • OAuthResponse
          • OAuthResponseBinary
          • OAuthResponseJSON
          • OAuthResponseText
          • OAuthService
          • OAuthServiceBuilder
          • OAuthTokenExtractors
          • RequestType
        • pdf_output
        • rawSQL
        • RestWs plugin
        • rest_ws
          • WsContents
          • WsCookie
          • WsRequest
          • WsResponse
        • scheduler
        • serialize
        • textxport
          • DataProviderExport
          • TabExporter
        • udp
          • JSPacket
        • XmlReader
          • XmlNode
      • Browser Plugins
        • Block UI
        • Block UI (ref)
        • Dialogs Plugin
        • Idle
        • Idle (ref)
        • Key Listener
        • Key Listener (ref)
        • NGDesktop File
        • NGDesktop File (ref)
        • NGDesktop UI (ref)
        • NGDesktop Utils (ref)
        • NG Utils (ref)
        • Office Javascript API for Servoy
        • Phonegap
        • Web Notifications (Native)
        • Web Notifications (Toastr)
        • Window Plugin
        • Font Awesome
      • Modules
        • Smart Doc Editor Utils
        • svyAPI
          • Getting Started
        • svyLookup
          • Custom Templates
          • API Documentation
          • svyLookup v1
            • API Documentation v1.0.0
            • Base Form svyLookupTable v1.0.0
            • Base Form AbstractLookup v1.0.0
        • svyLookupExample
        • svyNavigation
          • API Documentation
            • API svyNavigation
            • API svyNavigationHistory
            • API svyNavigationUX
        • svyNavigationUX
        • svyNavigationUXSample
        • svyPopupFilter
          • Simple Filter Pickers
          • Custom Templates
          • API Documentation
            • API svyToolbarFilter
            • API svyPopupFilter
          • API Documentation v1
            • API svyToolbarFilter v1
            • API svyPopupFilter v1
        • svyProperties
        • svySearch
        • svySecurity
          • Overview
          • Token-based Auth and SSO (NEW!)
          • API Documentation
          • Getting Started
          • Tenant replication
          • Security Management Console
            • Classic Security Management Console
          • svySecurityUX
          • svyProperties
          • API Doc svyProperties
        • svySecurityConsole
        • svySecurityUX
        • svyUtils
          • Log Manager
          • Log Manager Appenders
          • Smart Doc Editor Utils
          • Custom Dialogs
          • Excel Utils
          • Full API Reference
          • Crypto Utils
        • svyUtils$Excel
        • svyUtils$NGClient
        • svyUtils$customDialogs
        • svyUtils$logManagerAppenders
        • svyUtils$tableGrid
      • Layout
        • Boostrap 12grid layout
          • Collapsible Container
          • Simple Collapsible
          • Center Container
          • Inline Group Container
          • Flexbox Layout
      • Solutions
        • Sample Application
          • Tutorial Part 1
          • Tutorial Part 2
      • Packages
        • UI Component Packages
          • Advanced Renderers
          • Bootstrap Components
          • Bootstrap Extra Components
          • Canvas
          • Chart JS
          • Fullcalendar Component
          • googlemaps
          • kanban
          • Servoy Core
          • Servoy Extra Components
          • Servoy NG-Grids
          • Servoy PDF Viewer
          • smartDocumentEditor
        • Browser Plugin Packages
          • Block UI
          • Core NG only Services
          • Key Listener
          • NGDesktop File
          • NGDesktop UI
          • NGDesktop Utils
          • Web Notifications
          • Idle Web Service
    • Servoy Developer
      • Menu
        • File
        • Edit
        • Source
        • Refactor
        • Navigate
        • Search
        • Project
        • Actions
        • Run
        • Window
        • Help
      • Toolbar
      • Solution Explorer
        • Resources
          • Database Servers
            • Database Server
              • Procedures
              • Tables
              • Views
          • Security
          • i18n
        • All Solutions
          • Solution
          • Active Solution
            • Scopes
              • Scope
                • Variables
            • Forms
              • Working Set
              • Form
                • Controller
                • Variables
                • Elements
                • Relations
            • Form Components
              • Form Component
            • Relations
              • Relation
            • ValueLists
              • ValueList
            • Menus
              • Menu
                • MenuItem
            • Media
              • Folder
              • File
            • DataSources
              • In Memory DataSources
                • In Memory DataSource
              • View Foundsets DataSources
                • View Foundset DataSources
            • Servoy Packages
              • Package
            • Modules
              • Module
        • Solution Explorer Contextual List
      • Views
        • Command Console
        • Console
        • Problems
        • Tasks
        • Bookmarks
        • Search
        • Form Hierarchy
        • Help
        • JUnit
        • Outline
        • Profiler
        • Properties
        • Project Explorer
        • Call Hierarchy
      • Editors and Wizards
        • Property configurator for columns
        • Relation Editor
        • Text Format Editor
        • Date Format Editor
        • Number Format Editor
        • Database Synchronization Wizard
        • Security Editor
        • SQL Editor
        • i18n Editor
        • File Import Wizard
        • File Export Wizard
        • WAR Export Wizard
        • NGDesktop Export Wizard
        • Table Editor
        • Metadata Synchronization Wizard
        • Database Server Connection Editor
        • Text Property Editor
        • Valuelist Editor
        • Form Editor
          • Parts of the Form Editor
          • Designing a Form
          • Layout Tools
          • Using Containers
          • Creating and Using Forms
          • Using Servoy Beans
          • Using Shapes
          • Form Editor Subtabs
          • [Tips and Shortcuts][reference/servoy-developer/object-editors/form-editor-tips_and_shortcuts.md]
          • Editong a Responsive LayoutForm
          • CSS Positioning
        • Form Hierarchy
        • Component Properties Editor
        • Variable Editor
        • Method Selection Wizard
        • New Solution Wizard
        • Application Event Types Editor
        • New Form Wizard
        • Form Dataproviders Configurator
        • Servoy Resource Locator
        • Datasource Selection Wizard
        • Sorting Fields Wizard
        • Scripting Editor
          • Getting Started-Overview of Script Editor
          • Code Writing Features
          • Code Navigation
          • Code Rewriting Tools
          • Refactoring
          • Code Formatting
          • Script Editor Tips and Shortcuts
          • Unit Tests
        • Theme Editor
          • General Properties
          • Sidenav Properties
          • Navbar Properties
          • Tabs Properties
          • Windows Properties
          • Dialogs Properties
          • Tables Properties
          • Breadcrumb specific style Properties
          • Brand colors Properties
          • Validations Properties
          • Margins and Padding Properties
        • Editor Selection
        • Run Configurations
        • Debug Configurations
        • Externalize Strings Wizard
        • Font Chooser Wizard
        • Color Chooser Wizard
        • Project Properties Configurator
        • Move Wizard
        • External Tools Configurations
        • About Servoy Developer
        • Servoy Developer Installation Details
        • Eclipse Marketplace Wizard
        • Install Available Software Wizard
        • Cheat Sheet Selection Wizard
        • Servoy Developer Help Wizard
        • Switch to Editor Wizard
        • Find Actions Wizard
        • Customize Perspective Configurator
        • Quick Search Wizard
        • Search Wizard
        • Encoding Wizard
        • Task Wizard
        • Find - Replace Wizard
        • Properties Editor
        • New Project Wizard
        • New Method Wizard
        • New Menu Wizard
          • New MenuItem Wizard
        • Menu Editor
        • ServoyMenu Selection Wizard
        • JSMenu compatible component selector
        • Permissions Configuration Dialog
      • Project File Structure
        • Servoy Installation Directory
          • servoy.properties
        • Workspace Folder
          • Resources Directory
            • Database Information (.dbi) Files
          • Solution Folder
      • Package Manager
      • Preferences
      • Property Types for components / services
      • Debugger
        • Debug Explorer
        • Breakpoints
          • Breakpoint Properties
        • Variables
        • Expressions
        • Interactive Console
    • Application Server
    • Servoy Cloud
      • Cloud Control Center
        • Home
          • Setup Namespace
          • User profile
            • My Profile
            • Support
        • Download IDE
        • Application Overview
          • Applications
            • Pipelines
              • Jobs
                • Packages
                  • Commits
                  • Artifacts
                  • Configuration
                  • Quality reports
                  • Build markers
                • Job Configuration
                  • Build and Deploy or Build
                  • Mobile
                  • Desktop
            • Environments
              • Metrics
                • Users
                • Databases
                  • Metrics
                • System Health
                • Log Activity
                • App performance
                • Query performance
              • Cloud reporting
            • Security
              • Permissions
              • Tenants
            • Reports
            • Security Login Designer
              • Single Sign-On
                • Sign in with Google
                • Sign in with Microsoft
          • Code Repositories
        • Project Management
          • Tickets
          • Backlog
          • Active Sprints
        • User Management
          • Users
          • Roles
        • Administration
          • Security
            • ServoyCloud Roles
          • Credentials
          • Settings
        • Add-Ons
      • Database Backup
      • E2E Cypress Testing
        • Using Cypress
      • On-Premise Deployment
      • Privacy policy (ServoyAI)
      • FAQ
      • Migrate to Servoy Cloud
    • Extensions Developement
      • Component and Services
        • Component Development
        • Service Development
        • Tools and Dev Tips to use for Component/Service developement
        • Manifest (.mf file)
        • Specification (.spec file)
          • Property Types
            • Array property types
            • Custom object property types
            • Findmode property type
            • Foundset property type
            • Tags
        • Directives And Filters
          • Sablotabsequence
        • Console (serverside)
        • ServoyApi (serverside)
      • Serverside Plugins
        • Data Convertors and Validators
        • UI Convertors
  • Release notes
    • Release notes
      • 2025.03
      • 2024.03 (LTS)
      • 2023.03 (LTS)
      • 2025.03 (Servoy Cloud)
      • 2024.12
      • 2024.12 (Servoy Cloud)
      • 2024.09
      • 2024.09 (Servoy Cloud)
      • 2024.06
      • 2024.06 (Servoy Cloud)
      • 2024.03 (Servoy Cloud)
      • 2023.12
      • 2023.12 (Servoy Cloud)
      • 2023.09
      • 2023.09 (Servoy Cloud)
      • 2023.06
      • 2022.03 (LTS)
      • 2022.12 What's new
      • 2022.12
      • 2022.09 What's new
      • 2022.09
      • 2022.06 What's new
      • 2022.06
      • 2021.03.3 (LTS)
Powered by GitBook
On this page
  • Overview
  • Returned Types
  • Properties Summarized
  • Methods Summarized
  • Properties Detailed
  • alwaysFollowPkSelection
  • disableRelatedSiblingsPrefetch
  • nullColumnValidatorEnabled
  • Methods Detailed
  • acquireLock(foundset, recordIndex)
  • acquireLock(foundset, recordIndex, lockName)
  • addTableFilterParam(query)
  • addTableFilterParam(query, filterName)
  • addTableFilterParam(datasource, dataprovider, operator, value)
  • addTableFilterParam(datasource, dataprovider, operator, value, filterName)
  • addTableFilterParam(serverName, tableName, dataprovider, operator, value)
  • addTableFilterParam(serverName, tableName, dataprovider, operator, value, filterName)
  • addTrackingInfo(columnName, value)
  • commitTransaction()
  • commitTransaction(saveFirst)
  • commitTransaction(saveFirst, revertSavedRecords)
  • convertFoundSet(foundset, related)
  • convertFoundSet(foundset, related)
  • convertToDataSet(foundset)
  • convertToDataSet(foundset, dataproviderNames)
  • convertToDataSet(values)
  • convertToDataSet(values, dataproviderNames)
  • convertToDataSet(ids)
  • copyMatchingFields(source, destination)
  • copyMatchingFields(source, destination, overwrite)
  • copyMatchingFields(source, destination, names)
  • createDataSourceByQuery(name, query, useTableFilters, max_returned_rows, types, pkNames)
  • createDataSourceByQuery(name, query, max_returned_rows)
  • createDataSourceByQuery(name, query, max_returned_rows, types)
  • createDataSourceByQuery(name, query, max_returned_rows, types, pkNames)
  • createDataSourceByQuery(name, server_name, sql_query, arguments, max_returned_rows)
  • createDataSourceByQuery(name, server_name, sql_query, arguments, max_returned_rows, types)
  • createDataSourceByQuery(name, server_name, sql_query, arguments, max_returned_rows, columnTypes, pkNames)
  • createEmptyDataSet()
  • createEmptyDataSet(rowCount, columnCount)
  • createEmptyDataSet(rowCount, columnNames)
  • createSelect(dataSource)
  • createSelect(dataSource, tableAlias)
  • createTableFilterParam(query)
  • createTableFilterParam(datasource, dataprovider, operator, value)
  • createTableFilterParam(serverName, tableName, dataprovider, operator, value)
  • dataSourceExists(dataSource)
  • flushCalculations(datasource, onlyUnstored)
  • flushCalculations(datasource, onlyUnstored, calcnames)
  • getAutoSave()
  • getDataModelClonesFrom(serverName)
  • getDataSetByQuery(query, useTableFilters, max_returned_rows)
  • getDataSetByQuery(query, max_returned_rows)
  • getDataSetByQuery(server_name, sql_query, arguments, max_returned_rows)
  • getDataSource(serverName, tableName)
  • getDataSourceServerName(dataSource)
  • getDataSourceTableName(dataSource)
  • getDatabaseProductName(serverName)
  • getEditedRecords()
  • getEditedRecords(foundset)
  • getEditedRecords(datasource)
  • getEditedRecords(datasource, filter)
  • getFailedRecords()
  • getFailedRecords(foundset)
  • getFoundSet(query)
  • getFoundSet(dataSource)
  • getFoundSet(serverName, tableName)
  • getFoundSetCount(foundset)
  • getFoundSetUpdater(foundset)
  • getNextSequence(dataSource, columnName)
  • getServerNames()
  • getTable(foundset)
  • getTable(record)
  • getTable(dataSource)
  • getTable(serverName, tableName)
  • getTableCount(dataSource)
  • getTableFilterParams(serverName)
  • getTableFilterParams(serverName, filterName)
  • getTableNames(serverName)
  • getViewFoundSet(name)
  • getViewFoundSet(name, query)
  • getViewFoundSet(name, query, register)
  • getViewNames(serverName)
  • hasLocks()
  • hasLocks(lockName)
  • hasNewRecords(foundset)
  • hasNewRecords(foundset, index)
  • hasRecordChanges(foundset)
  • hasRecordChanges(foundset, index)
  • hasRecords(foundset)
  • hasRecords(record, relationString)
  • hasTransaction()
  • mergeRecords(sourceRecord, combinedDestinationRecord)
  • mergeRecords(sourceRecord, combinedDestinationRecord, columnNames)
  • recalculate(foundsetOrRecord)
  • refreshRecordFromDatabase(foundset, index)
  • releaseAllLocks()
  • releaseAllLocks(lockName)
  • removeDataSource(uri)
  • removeTableFilterParam(serverName, filterName)
  • revertEditedRecords()
  • revertEditedRecords(foundset)
  • rollbackTransaction()
  • rollbackTransaction(rollbackEdited)
  • rollbackTransaction(rollbackEdited, revertSavedRecords)
  • saveData()
  • saveData(foundset)
  • saveData(record)
  • saveData(records)
  • setAutoSave(autoSave)
  • setCreateEmptyFormFoundsets()
  • setTableFilters(filterName, tableFilters)
  • startTransaction()
  • switchServer(sourceName, destinationName)
  • validate(record)
  • validate(record, customObject)

Was this helpful?

  1. Reference
  2. Servoy Core
  3. Developer API

Database Manager

PreviousJSLayoutContainerNextQUERY_COLUMN_TYPES

Last updated 2 months ago

Was this helpful?

(databaseManager)

Overview

The Database Manager offers extensive tools for managing datasources, queries, records, and transactions, enabling the creation of efficient and scalable data-driven applications. It supports interaction with both in-memory and database-bound datasources, advanced query construction, and record management.

The system allows dynamic creation of datasources using createDataSourceByQuery, which populates datasources with query results while enabling reuse if the data structure remains consistent. Developers can specify or infer column types and remove unused datasources using removeDataSource to optimize resource usage. Query handling is further enhanced with the QBSelect object, enabling the programmatic construction of complex queries. The manager also supports ViewFoundSets, which create filtered, read-only views of database tables suitable for custom data presentation and aggregation.

Record management is facilitated by functions like saveData for committing changes, validate for enforcing data constraints, and mergeRecords for resolving duplicate records by merging their associated data. Unsaved changes can be reverted with revertEditedRecords, and the system tracks edited, new, or unsaved records using functions like getEditedRecords. Developers can ensure data integrity by starting transactions with startTransaction and rolling back changes using rollbackTransaction if necessary.

Table filters enable the restriction of data access through both column-based and query-based conditions. Filters can be dynamically applied, updated, or removed using setTableFilters and removeTableFilterParam. The manager provides utilities like getTable to retrieve schema details, getTableCount to determine record counts, and getTableFilterParams to inspect active filters.

Lock management is supported through hasLocks to check acquired locks and releaseAllLocks to release them, ensuring safe multi-user interactions. To reflect external data changes, cached records can be refreshed using refreshRecordFromDatabase.

Validation tools ensure that records conform to constraints such as column lengths and non-null requirements through the validate function. Performance optimization is achieved with recalculate to refresh derived values and flushCalculations to clear unnecessary data in memory, reducing resource overhead.

These capabilities provide developers with a comprehensive framework for building robust and customizable database-driven solutions.

Returned Types

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Properties Summarized

Type
Name
Summary

Enable/disable the foundset behaviour to keep selection to the first row always, even if updates from other clients are received that add new records before the current first record.

Enable/disable the automatic prefetching of related foundsets for sibling records.

Enable/disable the default null validator for non null columns, makes it possible to do the checks later on when saving, when for example autosave is disabled.

Methods Summarized

Type
Name
Summary

Request 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 based on a query to all the foundsets based on a table.

Adds a filter based on a query 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.

Adds a filter to all the foundsets based on a table.

void

Add 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.

Create a table filter that can be applied to all the foundsets based on a table.

Create a table filter that can be applied to all the foundsets based on a table.

Create a table filter that can be applied to all the foundsets based on a table.

Check wether a data source exists.

void

This method differences for recalculate() that it only works on a datasource rows/records that are loaded in memory.

void

This method differences for recalculate() that it only works on a datasource rows/records that are loaded in memory.

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 or deleted records with outstanding (unsaved) data.

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

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

Returns an array of edited or deleted records with outstanding (unsaved) data for a datasource with a filter.

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 base 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 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 a ViewFoundSet that was created by getViewFoundSet(name,query,register) with the registerd boolean "true".

Returns a foundset object for a specified query.

Returns a foundset object for a specified query.

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 or is new unsaved record.

Returns true if the specified foundset, on a specific index or in any of its records, or the specified record has changes or is new unsaved record.

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.

void

Can 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).

Free resources allocated for a previously created data source.

Removes a previously defined table filter.

void

Reverts outstanding (not saved) in memory changes from edited records.

void

Reverts outstanding (not saved) in memory changes from edited records.

void

Rollback a transaction started by databaseManager.

void

Rollback a transaction started by databaseManager.

void

Rollback 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.

Saves all outstanding (unsaved) data and exits the current record.

Set autosave, if false then no saves or deletes will happen by the ui.

void

Turnoff the initial form foundset record loading, set this in the solution open method.

Apply multiple table filters to all the foundsets that are affected by the filters.

void

Start 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).

Validates the given record, it runs first the method that is attached to the entity event "onValidate".

Validates the given record, it runs first the method that is attached to the entity event "onValidate".

Properties Detailed

alwaysFollowPkSelection

Enable/disable the foundset behaviour to keep selection to the first row always, even if updates from other clients are received that add new records before the current first record.

If set to false [default], a foundset with selection on first record will keep the selected index to 1, but may change the selected record when a new record is received from another client. If set to true, the selected index may change but the selected record will be kept if possible.

Sample

databaseManager.alwaysFollowPkSelection = true; // enable

// test if enabled
if(databaseManager.alwaysFollowPkSelection) application.output('alwaysFollowPkSelection enabled')

disableRelatedSiblingsPrefetch

Enable/disable the automatic prefetching of related foundsets for sibling records.

For example, when orders from a record in a customer foundset are retrieved, already the orders of a few sibling records are also prefetched. By default this prefetch is enabled for SmartClient but is disabled for all serverbased clients like NGClient and HeadlessClient. Because server based client are close enough to the database that they can fetch the siblings themselfs

Sample

databaseManager.disableRelatedSiblingsPrefetch = false; // enable the siblings prefetch

// test if enabled
if(databaseManager.disableRelatedSiblingsPrefetch) application.output('prefetching of sibling related foundsets is enabled')

nullColumnValidatorEnabled

Enable/disable the default null validator for non null columns, makes it possible to do the checks later on when saving, when for example autosave is disabled.

Sample

databaseManager.nullColumnValidatorEnabled = false;//disable

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

Methods Detailed

acquireLock(foundset, recordIndex)

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()

By default this call doesn't try to lock records in the database itself. But the locks are tracked  in the Servoy Server itself.
If you need database locking because of others applications that can also read the table or you use the Broadcaster plugin for more then 1 servoy server on the same database,
you need to set the property 'servoy.record.lock.lockInDB' in the servoy.properties file to true. This will try to do a 'select for update no wait' on databases that supports this.
This can only be used together with a transaction, so before you aquire the lock a transaction must be started so the database lock is held on to the transaction connection.

Do not change the record data before that, because aquirelock will make sure with a select from the database that it really has the latest data.
If there are changes to columns that you changed before calling aquireLock these changes will be reverted, so you don't change something again that you didn't see really the value of first.

returns true if the lock could be acquired.

Parameters

Sample

//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');
}

acquireLock(foundset, recordIndex, lockName)

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()

By default this call doesn't try to lock records in the database itself. But the locks are tracked  in the Servoy Server itself.
If you need database locking because of others applications that can also read the table or you use the Broadcaster plugin for more then 1 servoy server on the same database,
you need to set the property 'servoy.record.lock.lockInDB' in the servoy.properties file to true. This will try to do a 'select for update no wait' on databases that supports this.
This can only be used together with a transaction, so before you aquire the lock a transaction must be started so the database lock is held on to the transaction connection.

Do not change the record data before that, because aquirelock will make sure with a select from the database that it really has the latest data.
If there are changes to columns that you changed before calling aquireLock these changes will be reverted, so you don't change something again that you didn't see really the value of first.

returns true if the lock could be acquired.

Parameters

Sample

//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');
}

addTableFilterParam(query)

Adds a filter based on a query to all the foundsets based on a table.

Filters on tables touched in the query will not be applied to the query filter. For example, when a table filter exists on the order_details table, a query filter with a join from orders to order_details will be applied to queries on the orders table, but the filter condition on the orders_details table will not be included.

returns true if the table filter could be applied.

Parameters

Sample

// Best way to call this in a global solution startup method, but filters may be added/removed at any time.
// Note that

var query = datasources.db.example_data.orders.createSelect();
query.where.add(
   query.or.add(
            query.columns.shipcity.eq('Amersfoort'))
   .add(    query.columns.shipcity.eq('Amsterdam')));

var success = databaseManager.addTableFilterParam(query, 'cityFilter')

addTableFilterParam(query, filterName)

Adds a filter based on a query to all the foundsets based on a table.

Filters on tables touched in the query will not be applied to the query filter. For example, when a table filter exists on the order_details table, a query filter with a join from orders to order_details will be applied to queries on the orders table, but the filter condition on the orders_details table will not be included.

returns true if the table filter could be applied.

Parameters

Sample

// Best way to call this in a global solution startup method, but filters may be added/removed at any time.
// Note that

var query = datasources.db.example_data.orders.createSelect();
query.where.add(
   query.or.add(
            query.columns.shipcity.eq('Amersfoort'))
   .add(    query.columns.shipcity.eq('Amsterdam')));

var success = databaseManager.addTableFilterParam(query, 'cityFilter')

addTableFilterParam(datasource, dataprovider, operator, value)

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 table filter could be applied.

Parameters

Sample

// 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')

// a filter can be created based on a query
var query = datasources.db.admin.messages.createSelect()
query.where.add(query.columns.messagesid.gt(10))
var success = databaseManager.addTableFilterParam(query, '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])
// use "sql:in" in stead of "in" to allow the value to be interpreted as a custom query
var success = databaseManager.addTableFilterParam('crm', 'orders', 'countrycode', 'sql: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])

addTableFilterParam(datasource, dataprovider, operator, value, filterName)

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 table filter could be applied.

Parameters

Sample

// 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')

// a filter can be created based on a query
var query = datasources.db.admin.messages.createSelect()
query.where.add(query.columns.messagesid.gt(10))
var success = databaseManager.addTableFilterParam(query, '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])
// use "sql:in" in stead of "in" to allow the value to be interpreted as a custom query
var success = databaseManager.addTableFilterParam('crm', 'orders', 'countrycode', 'sql: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])

addTableFilterParam(serverName, tableName, dataprovider, operator, value)

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 table filter could be applied.

Parameters

Sample

// 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')

// a filter can be created based on a query
var query = datasources.db.admin.messages.createSelect()
query.where.add(query.columns.messagesid.gt(10))
var success = databaseManager.addTableFilterParam(query, '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])
// use "sql:in" in stead of "in" to allow the value to be interpreted as a custom query
var success = databaseManager.addTableFilterParam('crm', 'orders', 'countrycode', 'sql: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])

addTableFilterParam(serverName, tableName, dataprovider, operator, value, filterName)

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 table filter could be applied.

Parameters

Sample

// 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')

// a filter can be created based on a query
var query = datasources.db.admin.messages.createSelect()
query.where.add(query.columns.messagesid.gt(10))
var success = databaseManager.addTableFilterParam(query, '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])
// use "sql:in" in stead of "in" to allow the value to be interpreted as a custom query
var success = databaseManager.addTableFilterParam('crm', 'orders', 'countrycode', 'sql: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])

addTrackingInfo(columnName, value)

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'

Parameters

Returns: void

Sample

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

commitTransaction()

Returns true if a transaction is committed; rollback if commit fails. Saves all edited records and commits the data.

Sample

// 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 canceled or the the commit did fail.
if (cancel || !databaseManager.commitTransaction())
{
	databaseManager.rollbackTransaction();
}

commitTransaction(saveFirst)

Returns true if a transaction is committed; rollback if commit fails.

Parameters

Sample

// 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 canceled or the the commit did fail.
if (cancel || !databaseManager.commitTransaction())
{
	databaseManager.rollbackTransaction();
}

commitTransaction(saveFirst, revertSavedRecords)

Returns true if a transaction is committed; rollback if commit fails.

Parameters

Sample

// 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 canceled or the the commit did fail.
if (cancel || !databaseManager.commitTransaction())
{
	databaseManager.rollbackTransaction();
}

convertFoundSet(foundset, related)

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.

Parameters

Sample

// 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);

convertFoundSet(foundset, related)

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.

Parameters

Sample

// 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);

convertToDataSet(foundset)

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.

Parameters

Sample

// 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');

convertToDataSet(foundset, dataproviderNames)

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.

Parameters

Sample

// 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');

convertToDataSet(values)

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.

Parameters

Sample

// 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');

convertToDataSet(values, dataproviderNames)

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.

Parameters

Sample

// 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');

convertToDataSet(ids)

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.

Parameters

Sample

// 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');

copyMatchingFields(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). 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:

Parameters

Sample

otherfoundset.loadAllRecords();
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();
//}

copyMatchingFields(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). 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:

Parameters

Sample

otherfoundset.loadAllRecords();
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();
//}

copyMatchingFields(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). 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:

Parameters

Sample

otherfoundset.loadAllRecords();
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();
//}

createDataSourceByQuery(name, query, useTableFilters, max_returned_rows, types, pkNames)

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.

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.

Parameters

Sample

// select customer data for order 1234
var q = datasources.db.example_data.customers.createSelect()
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, true, 999, null, ['customer_id']);
//var uri = databaseManager.createDataSourceByQuery('mydata', q, true, 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();

createDataSourceByQuery(name, query, max_returned_rows)

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.

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.

Parameters

Sample

// select customer data for order 1234
var q = datasources.db.example_data.customers.createSelect()
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, true, 999, null, ['customer_id']);
//var uri = databaseManager.createDataSourceByQuery('mydata', q, true, 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();

createDataSourceByQuery(name, query, max_returned_rows, types)

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.

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.

Parameters

Sample

// select customer data for order 1234
var q = datasources.db.example_data.customers.createSelect();
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();

createDataSourceByQuery(name, query, max_returned_rows, types, pkNames)

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.

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.

Parameters

Sample

// select customer data for order 1234
var q = datasources.db.example_data.customers.createSelect();
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();

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. 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.

Parameters

Sample

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();

createDataSourceByQuery(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. 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.

Parameters

Sample

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();

createDataSourceByQuery(name, server_name, sql_query, arguments, max_returned_rows, columnTypes, pkNames)

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.

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.

Parameters

Sample

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();

createEmptyDataSet()

Returns an empty dataset object.

Sample

// 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'))

createEmptyDataSet(rowCount, columnCount)

Returns an empty dataset object.

Parameters

Sample

// 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'))

createEmptyDataSet(rowCount, columnNames)

Returns an empty dataset object.

Parameters

Sample

// 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'))

createSelect(dataSource)

Create a QueryBuilder object for a datasource.

Parameters

Sample

/** @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))
datasources.db.example_data.book_nodes.getFoundSet().loadRecords(q)

createSelect(dataSource, tableAlias)

Create a QueryBuilder object for a datasource with given table alias. The alias can be used inside custom queries to bind to the outer table.

Parameters

Sample

/** @type {QBSelect<db:/example_data/book_nodes>} */
var q = databaseManager.createSelect('db:/example_data/book_nodes', 'b');
q.result.addPk()
q.where.add(q.columns.label_text.isin('select comment_text from book_text t where t.note_text = ? and t.node_id = b.node_id', ['test']))
datasources.db.example_data.book_nodes.getFoundSet().loadRecords(q)

createTableFilterParam(query)

Create a table filter that can be applied to all the foundsets based on a table. Multiple filters can be applied at the same time using databaseManager.setTableFilters().

Filters on tables touched in the query will not be applied to the query filter. For example, when a table filter exists on the order_details table, a query filter with a join from orders to order_details will be applied to queries on the orders table, but the filter condition on the orders_details table will not be included.

Parameters

Sample

// 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 filter = databaseManager.createTableFilterParam('admin', 'messages', 'messagesid', '>', 10)

// a filter can be created based on a query
var query = datasources.db.admin.messages.createSelect()
query.where.add(query.columns.messagesid.gt(10))
var filter = databaseManager.createTableFilterParam(query)

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

// some filters with in-conditions
var filter = databaseManager.createTableFilterParam('crm', 'products', 'productcode', 'in', [120, 144, 200])
// use "sql:in" in stead of "in" to allow the value to be interpreted as a custom query
var filter = databaseManager.createTableFilterParam('crm', 'orders', 'countrycode', 'sql: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 filter = databaseManager.createTableFilterParam('crm', 'companies', 'companyname', '#^||=', 'servoy')

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

// if you want to add a filter for a column (created by you) in the i18n table
var filter = databaseManager.createTableFilterParam('database', 'your_i18n_table', 'message_variant', 'in', [1, 2])

// apply multiple filters at the same time, previous filters with the same name are removed:
var success = databaseManager.setTableFilters('myfilters', [filter1, filter2])

createTableFilterParam(datasource, dataprovider, operator, value)

Create a table filter that can be applied to all the foundsets based on a table. Multiple filters can be applied at the same time using databaseManager.setTableFilters().

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.

Parameters

Sample

// 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 filter = databaseManager.createTableFilterParam('admin', 'messages', 'messagesid', '>', 10)

// a filter can be created based on a query
var query = datasources.db.admin.messages.createSelect()
query.where.add(query.columns.messagesid.gt(10))
var filter = databaseManager.createTableFilterParam(query)

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

// some filters with in-conditions
var filter = databaseManager.createTableFilterParam('crm', 'products', 'productcode', 'in', [120, 144, 200])
// use "sql:in" in stead of "in" to allow the value to be interpreted as a custom query
var filter = databaseManager.createTableFilterParam('crm', 'orders', 'countrycode', 'sql: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 filter = databaseManager.createTableFilterParam('crm', 'companies', 'companyname', '#^||=', 'servoy')

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

// if you want to add a filter for a column (created by you) in the i18n table
var filter = databaseManager.createTableFilterParam('database', 'your_i18n_table', 'message_variant', 'in', [1, 2])

// apply multiple filters at the same time, previous filters with the same name are removed:
var success = databaseManager.setTableFilters('myfilters', [filter1, filter2])

createTableFilterParam(serverName, tableName, dataprovider, operator, value)

Create a table filter that can be applied to all the foundsets based on a table. Multiple filters can be applied at the same time using databaseManager.setTableFilters().

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.

Parameters

Sample

// 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 filter = databaseManager.createTableFilterParam('admin', 'messages', 'messagesid', '>', 10)

// a filter can be created based on a query
var query = datasources.db.admin.messages.createSelect()
query.where.add(query.columns.messagesid.gt(10))
var filter = databaseManager.createTableFilterParam(query)

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

// some filters with in-conditions
var filter = databaseManager.createTableFilterParam('crm', 'products', 'productcode', 'in', [120, 144, 200])
// use "sql:in" in stead of "in" to allow the value to be interpreted as a custom query
var filter = databaseManager.createTableFilterParam('crm', 'orders', 'countrycode', 'sql: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 filter = databaseManager.createTableFilterParam('crm', 'companies', 'companyname', '#^||=', 'servoy')

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

// if you want to add a filter for a column (created by you) in the i18n table
var filter = databaseManager.createTableFilterParam('database', 'your_i18n_table', 'message_variant', 'in', [1, 2])

// apply multiple filters at the same time, previous filters with the same name are removed:
var success = databaseManager.setTableFilters('myfilters', [filter1, filter2])

dataSourceExists(dataSource)

Check wether a data source exists. This function can be used for any type of data source (db-based, in-memory).

Parameters

Sample

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

flushCalculations(datasource, onlyUnstored)

This method differences for recalculate() that it only works on a datasource rows/records that are loaded in memory. It will not cause extra rows of that datasource to be loaded in memory (except if a calc itself would do that)

if onlyUnstored is true, then only unstored calculations will be flushed. (so also not causing any saves to the database)

Parameters

Returns: void

Sample

// flushed all unstored caclulations of the foundsets datasource.
databaseManager.flushCalculations(datasource, true);

flushCalculations(datasource, onlyUnstored, calcnames)

This method differences for recalculate() that it only works on a datasource rows/records that are loaded in memory. It will not cause extra rows of that datasource to be loaded in memory (except if a calc itself would do that)

if onlyUnstored is true, then only unstored calculations will be flushed. (so also not causing any saves to the database)

Parameters

Returns: void

Sample

// flushed all unstored caclulations of the foundsets datasource.
databaseManager.flushCalculations(datasource, true);

getAutoSave()

Returns true or false if autosave is enabled or disabled.

Sample

// Set autosave, if false then no saves or deletes will happen by the ui. 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)

getDataModelClonesFrom(serverName)

Retrieves a list with names of all database servers that have property DataModelCloneFrom equal to the server name parameter.

Parameters

Sample

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

getDataSetByQuery(query, useTableFilters, max_returned_rows)

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

Parameters

Sample

// use the query from a 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, true, maxReturnedRows);

// query: select PK from example.book_nodes where parent = 111 and(note_date is null or note_date > now)
var query = datasources.db.example_data.book_nodes.createSelect().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, true, max_returned_rows)

getDataSetByQuery(query, max_returned_rows)

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.

Parameters

Sample

// 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)
var query = datasources.db.example_data.book_nodes.createSelect().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)

getDataSetByQuery(server_name, sql_query, arguments, max_returned_rows)

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

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

Parameters

Sample

//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)

getDataSource(serverName, tableName)

Returns the datasource corresponding to the given server/table.

Parameters

Sample

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

getDataSourceServerName(dataSource)

Returns the server name from the datasource, or null if not a database datasource.

Parameters

Sample

var servername = databaseManager.getDataSourceServerName(datasource);

getDataSourceTableName(dataSource)

Returns the table name from the datasource, or null if not a database datasource.

Parameters

Sample

var tablename = databaseManager.getDataSourceTableName(datasource);

getDatabaseProductName(serverName)

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.

Parameters

Sample

var databaseProductName = databaseManager.getDatabaseProductName(servername)

getEditedRecords()

Returns an array of edited or deleted 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.

Sample

// 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);

getEditedRecords(foundset)

Returns an array of edited or deleted 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.

Parameters

Sample

// This method can be used to loop through all outstanding changes in a foundset,
// the application.output line contains all the changed data, their tablename and primary key
var editr = databaseManager.getEditedRecords(foundset)
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));
	}
}
databaseManager.saveData(foundset);// save all records from foundset

getEditedRecords(datasource)

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

Parameters

Sample

// This method can be used to loop through all outstanding changes for a specific datasource.
// The application.output line contains all the changed data, their tablename and primary key
var edits = databaseManager.getEditedRecords(datasources.db.mydb.mytable.getDataSource())

var jsTable = databaseManager.getTable('mydb', 'mytable');
var tableSQLName = jstable.getSQLName();
var pkColumnNames = jstable.getRowIdentifierColumnNames().join(',');
var pkValues [];

var x;
var ds;
var i;

for (x = 0; x < edits.length; x++) {
	ds = edits[x].getChangedData();
	pkValues.length = 0;

	for (i = 0; i < jsTable.getRowIdentifierColumnNames().length; i++) {
		pkValues[i] = edits[x][jsTable.getRowIdentifierColumnNames()[i]];
	}

	application.output('Table: ' + tableSQLName + ', PKs: ' + pkValues.join(',') + ' (' + pkColumnNames + ')');

	// Output the outstanding changes on each record
	for (i = 1; i <= ds.getMaxRowIndex(); i++) {
		application.output('Column: ' + ds.getValue(i, 1) + ', oldValue: ' + ds.getValue(i, 2) + ', newValue: ' + ds.getValue(i, 3));
	}
}
databaseManager.saveData(edits); //save all edited records in the datasource

getEditedRecords(datasource, filter)

Returns an array of edited or deleted records with outstanding (unsaved) data for a datasource with a filter.

Parameters

Sample

// This method can be used to loop through all outstanding changes for a specific datasource.
// The application.output line contains all the changed data, their tablename and primary key.
// Filter on records that match certain criteria.
// The criteria can be specified in a javascript object, for example get edited records for country NL or DE and currency EUR.
var edits = databaseManager.getEditedRecords(datasources.db.mydb.mytable.getDataSource(), {currency: 'EUR', country: ['NL', 'DE']})

var jsTable = databaseManager.getTable('mydb', 'mytable');
var tableSQLName = jstable.getSQLName();
var pkColumnNames = jstable.getRowIdentifierColumnNames().join(',');
var pkValues [];

var x;
var ds;
var i;

for (x = 0; x < edits.length; x++) {
	ds = edits[x].getChangedData();
	pkValues.length = 0;

	for (i = 0; i < jsTable.getRowIdentifierColumnNames().length; i++) {
		pkValues[i] = edits[x][jsTable.getRowIdentifierColumnNames()[i]];
	}

	application.output('Table: ' + tableSQLName + ', PKs: ' + pkValues.join(',') + ' (' + pkColumnNames + ')');

	// Output the outstanding changes on each record
	for (i = 1; i <= ds.getMaxRowIndex(); i++) {
		application.output('Column: ' + ds.getValue(i, 1) + ', oldValue: ' + ds.getValue(i, 2) + ', newValue: ' + ds.getValue(i, 3));
	}
}
databaseManager.saveData(edits); //save all edited records in the datasource

getFailedRecords()

Returns an array of records that fail after a save.

Sample

var array = databaseManager.getFailedRecords()
for( var i = 0 ; i < array.length ; i++ )
{
	var record = array[i];
	application.output(record.exception);
	if (record.exception.getErrorCode() === ServoyException.RECORD_VALIDATION_FAILED)
	{
		// exception thrown in pre-insert/update/delete event method
		var thrown = record.exception.getValue()
		application.output("Record validation failed: "+thrown)
	}
	else if (record.exception.getErrorCode() !== ServoyException.MUST_ROLLBACK)
	{
		// some other exception (ServoyException.MUST_ROLLBACK are records that were not saved because of previous errors in the transaction)
	}
	// find out the table of the record (similar to getEditedRecords)
	var jstable = databaseManager.getTable(record);
	var tableSQLName = jstable.getSQLName();
	application.output('Table:'+tableSQLName+' in server:'+jstable.getServerName()+' failed to save.')
}

getFailedRecords(foundset)

Returns an array of records that fail after a save.

Parameters

Sample

var array = databaseManager.getFailedRecords(foundset)
for( var i = 0 ; i < array.length ; i++ )
{
	var record = array[i];
	application.output(record.exception);
	if (record.exception.getErrorCode() == ServoyException.RECORD_VALIDATION_FAILED)
	{
		// exception thrown in pre-insert/update/delete event method
		var thrown = record.exception.getValue()
		application.output("Record validation failed: "+thrown)
	}
	// find out the table of the record (similar to getEditedRecords)
	var jstable = databaseManager.getTable(record);
	var tableSQLName = jstable.getSQLName();
	application.output('Table:'+tableSQLName+' in server:'+jstable.getServerName()+' failed to save.')
}

getFoundSet(query)

Returns a foundset object for a specified pk base query. This creates a filtered "view" on top of the database table based on that query.

This foundset is different then when doing foundset.loadRecords(query) or datasources.db.server.table.loadRecords(query) because this is generated as a "view"
Which means that the foundset will always have this query as its  base, even when doing foundset.loadAllRecords() afterwards. Because this query is set as its "creation query"
JSFoundset.loadRecords(query) does set that query on the current foundset as a a "search" condition. which will be removed when doing a loadAllRecords().

 So doing a clear() on a foundse created by this call will just add a "search" condition that results in no records found ( 1 = 2) and then loadAllRecords() will go back to this query.
 But in a foundset.loadRecord(query) then clear() will overwrite the "search" condition which is the given query so the query will be lost after that so loadAllRecords() will go back to all records in the table)

Parameters

Sample

var qb = datasources.db.example_data.orders.createSelect();
qb.result.addPk();
qb.where.add(qb.columns.product_id.eq(1))
var fs = databaseMananger.getFoundSet(qb);

getFoundSet(dataSource)

Returns 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()

Parameters

Sample

// type the foundset returned from the call with JSDoc, fill in the right server/tablename
/** @type {JSFoundset<db:/servername/tablename>} */
var fs = databaseManager.getFoundSet(controller.getDataSource())
// same as datasources.db.example_data.orders.getFoundSet() or datasources.mem['myds'].getFoundSet()
var ridx = fs.newRecord()
var record = fs.getRecord(ridx)
record.emp_name = 'John'
databaseManager.saveData()

getFoundSet(serverName, tableName)

Returns a foundset object for a specified datasource or server and tablename.

Parameters

Sample

// type the foundset returned from the call with JSDoc, fill in the right server/tablename
/** @type {JSFoundset<db:/servername/tablename>} */
var fs = databaseManager.getFoundSet(controller.getDataSource())
// same as datasources.db.example_data.orders.getFoundSet() or datasources.mem['myds'].getFoundSet()
var ridx = fs.newRecord()
var record = fs.getRecord(ridx)
record.emp_name = 'John'
databaseManager.saveData()

getFoundSetCount(foundset)

Returns the total number of records in a foundset.

NOTE: This can be an expensive operation (time-wise) if your resultset is large.

Parameters

Sample

//return the total number of records in a foundset.
databaseManager.getFoundSetCount(foundset);

getFoundSetUpdater(foundset)

Returns a JSFoundsetUpdater object that can be used to update all or a specific number of rows in the specified foundset.

Parameters

Sample

//1) update entire foundset
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
fsUpdater.setColumn('customer_type',1)
fsUpdater.setColumn('my_flag',0)
fsUpdater.performUpdate()

//2) update part of foundset, for example the first 4 row (starts with selected row)
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
fsUpdater.setColumn('customer_type',new Array(1,2,3,4))
fsUpdater.setColumn('my_flag',new Array(1,0,1,0))
fsUpdater.performUpdate()

//3) safely loop through foundset (starts with selected row)
controller.setSelectedIndex(1)
var count = 0
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
while(fsUpdater.next())
{
	fsUpdater.setColumn('my_flag',count++)
}

getNextSequence(dataSource, columnName)

Gets 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.

Parameters

Sample

var seqDataSource = forms.seq_table.controller.getDataSource();
var nextValue = databaseManager.getNextSequence(seqDataSource, 'seq_table_value');
application.output(nextValue);

nextValue = databaseManager.getNextSequence(databaseManager.getDataSourceServerName(seqDataSource), databaseManager.getDataSourceTableName(seqDataSource), 'seq_table_value')
application.output(nextValue);

getServerNames()

Returns 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.

Sample

var array = databaseManager.getServerNames()

getTable(foundset)

Returns 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.

Parameters

Sample

var jstable = databaseManager.getTable(controller.getDataSource());
//var jstable = databaseManager.getTable(foundset);
//var jstable = databaseManager.getTable(record);
//var jstable = databaseManager.getTable(datasource);
var tableSQLName = jstable.getSQLName();
var columnNamesArray = jstable.getColumnNames();
var firstColumnName = columnNamesArray[0];
var jscolumn = jstable.getColumn(firstColumnName);
var columnLength = jscolumn.getLength();
var columnType = jscolumn.getTypeAsString();
var columnSQLName = jscolumn.getSQLName();
var isPrimaryKey = jscolumn.isRowIdentifier();

getTable(record)

Returns 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.

Parameters

Sample

var jstable = databaseManager.getTable(controller.getDataSource());
//var jstable = databaseManager.getTable(foundset);
//var jstable = databaseManager.getTable(record);
//var jstable = databaseManager.getTable(datasource);
var tableSQLName = jstable.getSQLName();
var columnNamesArray = jstable.getColumnNames();
var firstColumnName = columnNamesArray[0];
var jscolumn = jstable.getColumn(firstColumnName);
var columnLength = jscolumn.getLength();
var columnType = jscolumn.getTypeAsString();
var columnSQLName = jscolumn.getSQLName();
var isPrimaryKey = jscolumn.isRowIdentifier();

getTable(dataSource)

Returns 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.

Parameters

Sample

var jstable = databaseManager.getTable(controller.getDataSource());
//var jstable = databaseManager.getTable(foundset);
//var jstable = databaseManager.getTable(record);
//var jstable = databaseManager.getTable(datasource);
var tableSQLName = jstable.getSQLName();
var columnNamesArray = jstable.getColumnNames();
var firstColumnName = columnNamesArray[0];
var jscolumn = jstable.getColumn(firstColumnName);
var columnLength = jscolumn.getLength();
var columnType = jscolumn.getTypeAsString();
var columnSQLName = jscolumn.getSQLName();
var isPrimaryKey = jscolumn.isRowIdentifier();

getTable(serverName, tableName)

Returns 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.

Parameters

Sample

var jstable = databaseManager.getTable(controller.getDataSource());
//var jstable = databaseManager.getTable(foundset);
//var jstable = databaseManager.getTable(record);
//var jstable = databaseManager.getTable(datasource);
var tableSQLName = jstable.getSQLName();
var columnNamesArray = jstable.getColumnNames();
var firstColumnName = columnNamesArray[0];
var jscolumn = jstable.getColumn(firstColumnName);
var columnLength = jscolumn.getLength();
var columnType = jscolumn.getTypeAsString();
var columnSQLName = jscolumn.getSQLName();
var isPrimaryKey = jscolumn.isRowIdentifier();

getTableCount(dataSource)

Returns the total number of records(rows) in a table.

NOTE: This can be an expensive operation (time-wise) if your resultset is large

Parameters

Sample

//return the total number of rows in a table.
var count = databaseManager.getTableCount(foundset);

getTableFilterParams(serverName)

Returns a two dimensional array object containing the table filter information currently applied to the servers tables. For column-based table filters, a row of 5 fields per filter are returned. The "columns" of a row from this array are: tablename, dataprovider, operator, value, filtername

For query-based filters, a row of 2 fields per filter are returned. The "columns" of a row from this array are: query, filtername

Parameters

Sample

var params = databaseManager.getTableFilterParams(databaseManager.getDataSourceServerName(controller.getDataSource()))
for (var i = 0; params != null && i < params.length; i++)
{
 if (params[i].length() == 5) {
		application.output('Table filter on table ' + params[i][0] + ': '+ params[i][1] + ' '+params[i][2] + ' '+params[i][3] + (params[i][4] == null ? ' [no name]' : ' ['+params[i][4]+']'))
	}
 if (params[i].length() == 2) {
		application.output('Table filter with query ' + params[i][0]+ ': ' + (params[i][1] == null ? ' [no name]' : ' ['+params[i][1]+']'))
	}
}

getTableFilterParams(serverName, filterName)

Returns a two dimensional array object containing the table filter information currently applied to the servers tables. For column-based table filters, a row of 5 fields per filter are returned. The "columns" of a row from this array are: tablename, dataprovider, operator, value, filtername

For query-based filters, a row of 2 fields per filter are returned. The "columns" of a row from this array are: query, filtername

Parameters

Sample

var params = databaseManager.getTableFilterParams(databaseManager.getDataSourceServerName(controller.getDataSource()))
for (var i = 0; params != null && i < params.length; i++)
{
 if (params[i].length() == 5) {
		application.output('Table filter on table ' + params[i][0] + ': '+ params[i][1] + ' '+params[i][2] + ' '+params[i][3] + (params[i][4] == null ? ' [no name]' : ' ['+params[i][4]+']'))
	}
 if (params[i].length() == 2) {
		application.output('Table filter with query ' + params[i][0]+ ': ' + (params[i][1] == null ? ' [no name]' : ' ['+params[i][1]+']'))
	}
}

getTableNames(serverName)

Returns an array of all table names for a specified server.

Parameters

Sample

//return all the table names as array
var tableNamesArray = databaseManager.getTableNames('user_data');
var firstTableName = tableNamesArray[0];

getViewFoundSet(name)

Returns a ViewFoundSet that was created by getViewFoundSet(name,query,register) with the registerd boolean "true". So it is registered and remembered by the system to use in Forms. You can't get ViewFoundSet back that are not registered to the system, those are not remembered.

Parameters

getViewFoundSet(name, query)

Returns a foundset object for a specified query. This just creates one without keeping any reference to it, you have to use the getViewFoundSet(name,query,true) for registering it to the system. ViewFoundSets are different then normal foundsets because they have a lot less methods, stuff like newRecord/deleteRecord don't work.

If you query the pk with the columns that you display for the main or join tables then those columns can be updated and through ViewFoundSet#save(ViewRecord) they can be saved. If there are changes in ViewRecords of this ViewFoundSet then databroadcast configurations that need to load new data won't do the query right away (only after the save) Also loading more (the next chunksize) will not be done. This is because the ViewRecord on an index can be completely changed. We can't track those.

Also databroadcast can be enabled by calling one of the ViewFoundSet#enableDatabroadcastFor(QBTableClause) to listen for that specific table (main or joins). Flags can be used to control what exactly should be monitored, some don't cost a lot of overhead others have to do a full re-query to see the changes.

Parameters

Sample

// create a new view foundset and also directly register it to the system so they can be picked up by forms if a form has the view datasource.
/** @type {ViewFoundSet<view:myname>} */
var vfs = databaseManager.getViewFoundSet('myname', query, true)

getViewFoundSet(name, query, register)

Returns a foundset object for a specified query. If the boolean register is true then the system will register it to the system so it can be used in Forms. Also getViewFoundSet(name) will then return that instance. ViewFoundSets are different then normal foundsets because they have a lot less methods, stuff like newRecord/deleteRecord don't work.

If you query the pk with the columns that you display for the main or join tables then those columns can be updated and through ViewFoundSet#save(ViewRecord) they can be saved. If there are changes in ViewRecords of this ViewFoundSet then databroadcast configurations that need to load new data won't do the query right away (only after the save) Also loading more (the next chunksize) will not be done. This is because the ViewRecord on an index can be completely changed. We can't track those.

Also databroadcast can be enabled by calling one of the ViewFoundSet#enableDatabroadcastFor(QBTableClause) to listen for that specific table (main or joins). Flags can be used to control what exactly should be monitored, some don't cost a lot of overhead others have to do a full re-query to see the changes.

if the register boolean is true, then the given ViewFoundSet is registered to the system so it is picked up by forms that have this datasource (see viewFoundset.getDatasource() for the actual datasource string) assigned. The form's foundset will then have a much more limited API, so a lot of things can't be done with it - e.g. newRecord() or deleteRecords(). Also records can be updated in memory, so they are not fully read-only, but the developer is responsible for saving these changes to a persisted store. See also viewFoundset.save(...).

If the solution doesn't need this ViewFoundSet anymore and you did use register is true, please use ViewFoundSet.dispose() to clear and remove it from the system, because otherwise this register call will keep/hold this foundset in memory (for that datasource string to work) forever.

Parameters

Sample

// create a new view foundset and also directly register it to the system so they can be picked up by forms if a form has the view datasource.
/** @type {ViewFoundSet<view:myname>} */
var vfs = databaseManager.getViewFoundSet('myname', query, true)

getViewNames(serverName)

Returns an array of all view names for a specified server.

Parameters

Sample

//return all the view names as array
var viewNamesArray = databaseManager.getViewNames('user_data');
var firstViewName = viewNamesArray[0];

hasLocks()

Returns true if the current client has any or the specified lock(s) acquired.

Sample

var hasLocks = databaseManager.hasLocks('mylock')

hasLocks(lockName)

Returns true if the current client has any or the specified lock(s) acquired.

Parameters

Sample

var hasLocks = databaseManager.hasLocks('mylock')

hasNewRecords(foundset)

Returns true if the argument (foundSet / record) has at least one row that was not yet saved in the database.

Parameters

Sample

var fs = databaseManager.getFoundSet(databaseManager.getDataSourceServerName(controller.getDataSource()),'employees');
databaseManager.startTransaction();
var ridx = fs.newRecord();
var record = fs.getRecord(ridx);
record.emp_name = 'John';
if (databaseManager.hasNewRecords(fs)) {
	application.output("new records");
} else {
	application.output("no new records");
}
databaseManager.saveData();
databaseManager.commitTransaction();

hasNewRecords(foundset, index)

Returns true if the argument (foundSet / record) has at least one row that was not yet saved in the database.

Parameters

Sample

var fs = databaseManager.getFoundSet(databaseManager.getDataSourceServerName(controller.getDataSource()),'employees');
databaseManager.startTransaction();
var ridx = fs.newRecord();
var record = fs.getRecord(ridx);
record.emp_name = 'John';
if (databaseManager.hasNewRecords(fs)) {
	application.output("new records");
} else {
	application.output("no new records");
}
databaseManager.saveData();
databaseManager.commitTransaction();

hasRecordChanges(foundset)

Returns true if the specified foundset, on a specific index or in any of its records, or the specified record has changes or is new unsaved record.

NOTE: The fields focus may be lost in user interface in order to determine the edits.

Parameters

Sample

if (databaseManager.hasRecordChanges(foundset,2))
{
	//do save or something else
}

hasRecordChanges(foundset, index)

Returns true if the specified foundset, on a specific index or in any of its records, or the specified record has changes or is new unsaved record.

NOTE: The fields focus may be lost in user interface in order to determine the edits.

Parameters

Sample

if (databaseManager.hasRecordChanges(foundset,2))
{
	//do save or something else
}

hasRecords(foundset)

Returns true if the (related)foundset exists and has records.

Parameters

Sample

if (myElement.hasRecords(orders_to_orderitems))
{
	//do work on relatedFoundSet
}
//if (myElement.hasRecords(foundset.getSelectedRecord(),'orders_to_orderitems.orderitems_to_products'))
//{
//	//do work on deeper relatedFoundSet
//}

hasRecords(record, relationString)

Returns true if the (related)foundset exists and has records.

Parameters

Sample

if (myElement.hasRecords(orders_to_orderitems))
{
	//do work on relatedFoundSet
}
//if (myElement.hasRecords(foundset.getSelectedRecord(),'orders_to_orderitems.orderitems_to_products'))
//{
//	//do work on deeper relatedFoundSet
//}

hasTransaction()

Returns true if there is an transaction active for this client.

Sample

var hasTransaction = databaseManager.hasTransaction()

mergeRecords(sourceRecord, combinedDestinationRecord)

Merge 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.

Parameters

Sample

databaseManager.mergeRecords(foundset.getRecord(1),foundset.getRecord(2));

mergeRecords(sourceRecord, combinedDestinationRecord, columnNames)

Merge 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.

Parameters

Sample

databaseManager.mergeRecords(foundset.getRecord(1),foundset.getRecord(2));

recalculate(foundsetOrRecord)

Can 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.

Parameters

Returns: void

Sample

// recalculate one record from a foundset.
databaseManager.recalculate(foundset.getRecord(1));
// recalculate all records from the foundset.
// please use with care, this can be expensive!
//databaseManager.recalculate(foundset);

refreshRecordFromDatabase(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. Used where a program external to Servoy has modified the database record. Giving 0 as the index will just refresh he selected record.

If the index is -1 then this method will refresh all the records of the datasource of the foundset, it does this by flusing all the records and the row data of the full datasource So everything is reloaded fully fresh when the foundsets will requery for there data. WARNING: Don't hold any references to JSRecord objects from before this call with -1 index. Those records objects are all in an invalid state because of the underlying data flush.

Parameters

Sample

//refresh the second record from the foundset.
databaseManager.refreshRecordFromDatabase(foundset,2)
//flushes all records in the related foundset datasource (so the whole table, so -1 is an expensive operation)
databaseManager.refreshRecordFromDatabase(order_to_orderdetails,-1);

releaseAllLocks()

Release all current locks the client has (optionally limited to named locks). return true if the locks are released.

Sample

databaseManager.releaseAllLocks('mylock')

releaseAllLocks(lockName)

Release all current locks the client has (optionally limited to named locks). return true if the locks are released.

Parameters

Sample

databaseManager.releaseAllLocks('mylock')

removeDataSource(uri)

Free resources allocated for a previously created data source. NOTE: make sure this datasource is not using anymore in forms or components! because the inmemory table and the foundset build on that table are all just removed.

Normally this will be automatically done if a client is removed/shutdown, but if constantly new stuff is created or you don't need it anymore from what the client currently is using or seeing, then removing this will clean up memory.

Parameters

Sample

databaseManager.removeDataSource(uri);

removeTableFilterParam(serverName, filterName)

Removes a previously defined table filter.

Parameters

Sample

var success = databaseManager.removeTableFilterParam('admin', 'higNumberedMessagesRule')

revertEditedRecords()

Reverts 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()

Returns: void

Sample

// Set autosave, if false then no saves or deletes will happen by the ui. Until you call saveData or setAutoSave(true)
// reverts 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.revertEditedRecords()
//databaseManager.revertEditedRecords(foundset); // rollback all records from foundset
//databaseManager.revertEditedRecords(foundset.getSelectedRecord()); // rollback only one record
databaseManager.setAutoSave(true)

revertEditedRecords(foundset)

Reverts 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()

Parameters

Returns: void

Sample

// Set autosave, if false then no saves or deletes will happen by the ui. Until you call saveData or setAutoSave(true)
// reverts 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.revertEditedRecords()
//databaseManager.revertEditedRecords(foundset); // rollback all records from foundset
//databaseManager.revertEditedRecords(foundset.getSelectedRecord()); // rollback only one record
databaseManager.setAutoSave(true)

rollbackTransaction()

Rollback 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 control 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)

Returns: void

Sample

// 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 canceled or the the commit did fail.
if (cancel || !databaseManager.commitTransaction())
{
	databaseManager.rollbackTransaction();
}

rollbackTransaction(rollbackEdited)

Rollback 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)

Parameters

Returns: void

Sample

// 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 canceled or the the commit did fail.
if (cancel || !databaseManager.commitTransaction())
{
	databaseManager.rollbackTransaction();
}

rollbackTransaction(rollbackEdited, revertSavedRecords)

Rollback a transaction started by databaseManager.startTransaction(). Note that when autosave is false, revertEditedRecords() will not handle deleted records, while rollbackTransaction() does.

Parameters

Returns: void

Sample

// 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 canceled or the the commit did fail.
if (cancel || !databaseManager.commitTransaction())
{
	databaseManager.rollbackTransaction();
}

saveData()

Saves 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. You can call saveData for a record or foundset inside a Table Event (save all will not work), and that will only save the records that are currently not being saved (to avoid infinite cycles). Since Servoy 8.3 saveData with null parameter does not call saveData() as fallback, it just returns false.

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 depending 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 immediately 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.

NOTE: When saveData() is called within a transaction, records after a record that fails with some sql-exception will not be saved, but moved to the failed records. record.exception.getErrorCode() will return ServoyException.MUST_ROLLBACK for these records.

Sample

var saved = databaseManager.saveData()
// var saved = databaseManager.saveData(foundset.getRecord(1)) // save specific record
// var saved = databaseManager.saveData(foundset) // save all records from foundset

// when creating many records in a loop do a batch save on an interval as every 10 records (to save on memory and roundtrips)
var success = true
for (var recordIndex = 1; success && recordIndex <= 5000; recordIndex++)
{
	foundset.newRecord()
	someColumn = recordIndex
	anotherColumn = "Index is: " + recordIndex
	if (recordIndex % 10 == 0) success = databaseManager.saveData()
}

// check the failed records
if (!success) {
  var failedRecords = databaseManager.getFailedRecords();
  for (var i = 0; i < failedRecords.length; i++) {
     var failedRecord = failedRecords[i]
     // failed[i].exception shows the error, failed[i].exception.getErrorCode() is one of the ServoyException.* values
  }
}

saveData(foundset)

Saves 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. You can call saveData for a record or foundset inside a Table Event (save all will not work), and that will only save the records that are currently not being saved (to avoid infinite cycles). Since Servoy 8.3 saveData with null parameter does not call saveData() as fallback, it just returns false.

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 depending 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 immediately 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.

NOTE: When saveData() is called within a transaction, records after a record that fails with some sql-exception will not be saved, but moved to the failed records. record.exception.getErrorCode() will return ServoyException.MUST_ROLLBACK for these records.

Parameters

Sample

var saved = databaseManager.saveData()
// var saved = databaseManager.saveData(foundset.getRecord(1)) // save specific record
// var saved = databaseManager.saveData(foundset) // save all records from foundset

// when creating many records in a loop do a batch save on an interval as every 10 records (to save on memory and roundtrips)
var success = true
for (var recordIndex = 1; success && recordIndex <= 5000; recordIndex++)
{
	foundset.newRecord()
	someColumn = recordIndex
	anotherColumn = "Index is: " + recordIndex
	if (recordIndex % 10 == 0) success = databaseManager.saveData()
}

// check the failed records
if (!success) {
  var failedRecords = databaseManager.getFailedRecords();
  for (var i = 0; i < failedRecords.length; i++) {
     var failedRecord = failedRecords[i]
     // failed[i].exception shows the error, failed[i].exception.getErrorCode() is one of the ServoyException.* values
  }
}

saveData(record)

Saves 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. You can call saveData for a record or foundset inside a Table Event (save all will not work), and that will only save the records that are currently not being saved (to avoid infinite cycles). Since Servoy 8.3 saveData with null parameter does not call saveData() as fallback, it just returns false.

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 depending 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 immediately 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.

NOTE: When saveData() is called within a transaction, records after a record that fails with some sql-exception will not be saved, but moved to the failed records. record.exception.getErrorCode() will return ServoyException.MUST_ROLLBACK for these records.

Parameters

Sample

var saved = databaseManager.saveData()
// var saved = databaseManager.saveData(foundset.getRecord(1)) // save specific record
// var saved = databaseManager.saveData(foundset) // save all records from foundset

// when creating many records in a loop do a batch save on an interval as every 10 records (to save on memory and roundtrips)
var success = true
for (var recordIndex = 1; success && recordIndex <= 5000; recordIndex++)
{
	foundset.newRecord()
	someColumn = recordIndex
	anotherColumn = "Index is: " + recordIndex
	if (recordIndex % 10 == 0) success = databaseManager.saveData()
}

// check the failed records
if (!success) {
  var failedRecords = databaseManager.getFailedRecords();
  for (var i = 0; i < failedRecords.length; i++) {
     var failedRecord = failedRecords[i]
     // failed[i].exception shows the error, failed[i].exception.getErrorCode() is one of the ServoyException.* values
  }
}

saveData(records)

Saves 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. You can call saveData for a record or foundset inside a Table Event (save all will not work), and that will only save the records that are currently not being saved (to avoid infinite cycles). Since Servoy 8.3 saveData with null parameter does not call saveData() as fallback, it just returns false.

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 depending 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 immediately 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.

NOTE: When saveData() is called within a transaction, records after a record that fails with some sql-exception will not be saved, but moved to the failed records. record.exception.getErrorCode() will return ServoyException.MUST_ROLLBACK for these records.

Parameters

Sample

var saved = databaseManager.saveData()
// var saved = databaseManager.saveData(foundset.getRecord(1)) // save specific record
// var saved = databaseManager.saveData(foundset) // save all records from foundset

// when creating many records in a loop do a batch save on an interval as every 10 records (to save on memory and roundtrips)
var success = true
for (var recordIndex = 1; success && recordIndex <= 5000; recordIndex++)
{
	foundset.newRecord()
	someColumn = recordIndex
	anotherColumn = "Index is: " + recordIndex
	if (recordIndex % 10 == 0) success = databaseManager.saveData()
}

// check the failed records
if (!success) {
  var failedRecords = databaseManager.getFailedRecords();
  for (var i = 0; i < failedRecords.length; i++) {
     var failedRecord = failedRecords[i]
     // failed[i].exception shows the error, failed[i].exception.getErrorCode() is one of the ServoyException.* values
  }
}

setAutoSave(autoSave)

Set autosave, if false then no saves or deletes will happen by the ui. Until you call databaseManager.saveData() or setAutoSave(true) *

Parameters

Sample

// Rollbacks in mem the records that were edited or deleted 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)

setCreateEmptyFormFoundsets()

Turnoff 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 records

Returns: void

Sample

//this has to be called in the solution open method
databaseManager.setCreateEmptyFormFoundsets()

setTableFilters(filterName, tableFilters)

Apply multiple table filters to all the foundsets that are affected by the filters. After all filters have been applied / updated, foundset changes will be applied in the client.

The filters that have been applied with the same filter name will be removed and replaced with the new set of filters (which may be empty).

Parameters

Sample

// Create a number of filters
var query1_nl = datasources.db.crm.companies.createSelect()
query.where.add(query1_nl.columns.countrycode.eq('nl'))
var filter1_nl = databaseManager.createTableFilterParam(query1_nl)

var filter2 = databaseManager.createTableFilterParam('example', 'orders', 'clusterid', '=', 10).dataBroadcast(true)

// apply multiple filters at the same time, previous filters with the same name are removed:
var success = databaseManager.setTableFilters('myfilters', [filter1_nl, filter2])

// update one of the filters:
var query1_us = datasources.db.crm.companies.createSelect()
query1_us.where.add(query1_us.columns.countrycode.eq('us'))
var filter1_us = databaseManager.createTableFilterParam(query1_us)

var success = databaseManager.setTableFilters('myfilters', [filter1_us, filter2])

// filters can be removed by setting them to an empty list:
var success = databaseManager.setTableFilters('myfilters', [])

// use the databroadCast flag on a filter to reduce databroadcast events
// for clients having a databroadcast filter set for the same column with a different value.
// Note that the dataBroadcast flag is *only* supported for simple filters, only for operator 'in' or '='.
var filter = databaseManager.createTableFilterParam('example', 'orders', 'clusterid', '=', 10).dataBroadcast(true)
var success = databaseManager.setTableFilters('clusterfilter', [filter])

startTransaction()

Start a database transaction. If you want to avoid round trips to the server or avoid the possibility of blocking other clients because of your pending changes, you can use databaseManager.setAutoSave(false/true) and databaseManager.rollbackEditedRecords().

Returns: void

Sample

// 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 canceled or the the commit did fail.
if (cancel || !databaseManager.commitTransaction())
{
	databaseManager.rollbackTransaction();
}

switchServer(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). return true if successful. Note that this only works if source and destination server are of the same database type.

Parameters

Sample

//dynamically changes a server for the entire solution, destination database server must contain the same tables/columns!
//will fail if there is a lock, transaction , if repository_server is used or if destination server is invalid
//in the solution keep using the sourceName every where to reference the server!
var success = databaseManager.switchServer('crm', 'crm1')

validate(record)

Validates the given record, it runs first the method that is attached to the entity event "onValidate". Then it will call also the entity events "onInsert" or "onUpdate" depending if the record is new or an update. All those methods do get a parameter JSRecordMarkers where the problems can be reported against.

All columns are then also null/empty checked and if they are and the Column is marked as "not null" an error will be added with the message key "servoy.record.error.null.not.allowed" for that column.

All changed columns are length checked and if the record values is bigger then what the database column can handle and error will be added with the message key "servoy.record.error.columnSizeTooSmall" for that column. Then all the column validators will be run over all the changed columns, The validators will also get the same JSRecordMarkers to report problems to. So the global method validator now also has more parameters then just the value.

These 3 validations (null, length and column validators) are not by default done any more on change of the dataprovider itself. This is controlled by the servoy property "servoy.execute.column.validators.only.on.validate_and_save" which can also be seen at the TableEditor column validators page.

An extra state object can be given that will also be passed around if you want to have more state in the validation objects (like giving some ui state so the entity methods know where you come from)

It will return a JSRecordMarkers when the record had validation problems

Parameters

validate(record, customObject)

Validates the given record, it runs first the method that is attached to the entity event "onValidate". Then it will call also the entity events "onInsert" or "onUpdate" depending if the record is new or an update. All those methods do get a parameter JSRecordMarkers where the problems can be reported against.

All columns are then also null/empty checked and if they are and the Column is marked as "not null" an error will be added with the message key "servoy.record.error.null.not.allowed" for that column.

All changed columns are length checked and if the record values is bigger then what the database column can handle and error will be added with the message key "servoy.record.error.columnSizeTooSmall" for that column. Then all the column validators will be run over all the changed columns, The validators will also get the same JSRecordMarkers to report problems to. So the global method validator now also has more parameters then just the value.

These 3 validations (null, length and column validators) are not by default done any more on change of the dataprovider itself. This is controlled by the servoy property "servoy.execute.column.validators.only.on.validate_and_save" which can also be seen at the TableEditor column validators page.

An extra state object can be given that will also be passed around if you want to have more state in the validation objects (like giving some ui state so the entity methods know where you come from)

It will return a JSRecordMarkers when the record had validation problems

Parameters


Type

Type

Type

foundset The JSFoundset to get the lock for

recordIndex The record index which should be locked.

Returns: true if the lock could be acquired.

foundset The JSFoundset to get the lock for

recordIndex The record index which should be locked.

lockName The name of the lock.

Returns: true if the lock could be acquired.

query condition to filter on.

Returns: true if the table filter could be applied.

query condition to filter on.

filterName The specified name of the database table filter.

Returns: true if the table filter could be applied.

datasource The datasource

dataprovider A specified dataprovider column name.

operator One of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null), prefix with "sql:" to allow the value to be interpreted as a custom query.

value The specified filter value.

Returns: true if the table filter could be applied.

datasource The datasource

dataprovider A specified dataprovider column name.

operator One of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null), prefix with "sql:" to allow the value to be interpreted as a custom query.

value The specified filter value.

filterName The specified name of the database table filter.

Returns: true if the table filter could be applied.

serverName The name of the database server connection for the specified table name.

tableName The name of the specified table.

dataprovider A specified dataprovider column name.

operator One of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null), prefix with "sql:" to allow the value to be interpreted as a custom query.

value The specified filter value.

Returns: true if the table filter could be applied.

serverName The name of the database server connection for the specified table name.

tableName The name of the specified table.

dataprovider A specified dataprovider column name.

operator One of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null), prefix with "sql:" to allow the value to be interpreted as a custom query..

value The specified filter value.

filterName The specified name of the database table filter.

Returns: true if the table filter could be applied.

columnName The name of the column in the log table, used for tracking info

value The value to be set when inserting a new row in the log table, for the 'columnName' column

Returns: if the transaction could be committed.

saveFirst save edited records to the database first (default true)

Returns: if the transaction could be committed.

saveFirst save edited records to the database first (default true)

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)

Returns: if the transaction could be committed.

foundset The JSFoundset to convert.

related can be a one-to-many relation object or the name of a one-to-many relation

Returns: The converted JSFoundset.

foundset The JSFoundset to convert.

related the name of a one-to-many relation

Returns: The converted JSFoundset.

foundset The foundset to be converted.

Returns: JSDataSet with the data.

foundset The foundset to be converted.

dataproviderNames Array with column names.

Returns: JSDataSet with the data.

values The values array.

Returns: JSDataSet with the data.

values The values array.

dataproviderNames The property names array.

Returns: JSDataSet with the data.

ids Concatenated values to be put into dataset.

Returns: JSDataSet with the data.

source The source record or (java/javascript)object to be copied.

destination The destination record to copy to.

Returns: true if no errors happened.

source The source record or (java/javascript)object to be copied.

destination The destination record to copy to.

overwrite Boolean values to overwrite all values. If overwrite is false/not provided, then the non empty values are not overwritten in the destination record.

Returns: true if no errors happened.

source The source record or (java/javascript)object to be copied.

destination The destination record to copy to.

names The property names that shouldn't be overriden.

Returns: true if no errors happened.

name Data source name

query The query builder to be executed.

useTableFilters use table filters (default true).

max_returned_rows The maximum number of rows returned by the query.

types The column types, when null the types are inferred from the query.

pkNames array of pk names, when null a hidden pk-column will be added

Returns: datasource containing the results of the query or null if the parameters are wrong.

name data source name

query The query builder to be executed.

max_returned_rows The maximum number of rows returned by the query.

Returns: datasource containing the results of the query or null if the parameters are wrong.

name Data source name

query The query builder to be executed.

max_returned_rows The maximum number of rows returned by the query.

types The column types

Returns: datasource containing the results of the query or null if the parameters are wrong.

name Data source name

query The query builder to be executed.

max_returned_rows The maximum number of rows returned by the query.

types The column types

pkNames array of pk names, when null a hidden pk-column will be added

Returns: datasource containing the results of the query or null if the parameters are wrong.

name data source name

server_name The name of the server where the query should be executed.

sql_query The custom sql, must start with 'select', 'call', 'with' or 'declare'.

arguments Specified arguments or null if there are no arguments.

max_returned_rows The maximum number of rows returned by the query.

Returns: datasource containing the results of the query or null if the parameters are wrong.

name data source name

server_name The name of the server where the query should be executed.

sql_query The custom sql, must start with 'select', 'call', 'with' or 'declare'.

arguments Specified arguments or null if there are no arguments.

max_returned_rows The maximum number of rows returned by the query.

types The column types

Returns: datasource containing the results of the query or null if the parameters are wrong.

name data source name

server_name The name of the server where the query should be executed.

sql_query The custom sql, must start with 'select', 'call', 'with' or 'declare'.

arguments Specified arguments or null if there are no arguments.

max_returned_rows The maximum number of rows returned by the query.

columnTypes The column types

pkNames array of pk names, when null a hidden pk-column will be added

Returns: datasource containing the results of the query or null if the parameters are wrong.

Returns: An empty JSDataSet with the initial sizes.

rowCount The number of rows in the DataSet object.

columnCount Number of columns.

Returns: An empty JSDataSet with the initial sizes.

rowCount ;

columnNames ;

Returns: An empty JSDataSet with the initial sizes.

dataSource The data source to build a query for.

Returns: query builder

dataSource The data source to build a query for.

tableAlias The alias for the main table.

Returns: query builder

query condition to filter on.

Returns: table filter.

datasource The datasource

dataprovider A specified dataprovider column name.

operator One of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null), prefix with "sql:" to allow the value to be interpreted as a custom query.

value The specified filter value.

Returns: table filter.

serverName The name of the database server connection for the specified table name.

tableName The name of the specified table.

dataprovider A specified dataprovider column name.

operator One of "=, <, >, >=, <=, !=, LIKE, or IN" optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null), prefix with "sql:" to allow the value to be interpreted as a custom query.

value The specified filter value.

Returns: table filter or null when no filter could be created.

dataSource the datasource string to check.

Returns: boolean exists

datasource The datasource to flush all calculations of

onlyUnstored to only go over the unstore cals of this datasource

datasource The datasource to flush all calculations of

onlyUnstored to only go over the unstore cals of this datasource

calcnames A string array of calculation names that need to be flushed, if null then all unstored (or all depending on the boolean)

Returns: true if autosave if enabled.

serverName ;

Returns: A list of names of all database servers that have the property DataModelCloneFrom set to the specified server name, or null if an error occurs or no such servers exist.

query QBSelect query.

useTableFilters use table filters (default true).

max_returned_rows The maximum number of rows returned by the query.

Returns: The JSDataSet containing the results of the query.

query QBSelect query.

max_returned_rows The maximum number of rows returned by the query.

Returns: The JSDataSet containing the results of the query.

server_name The name of the server where the query should be executed.

sql_query The custom sql, must start with 'select', 'call', 'with' or 'declare'.

arguments Specified arguments or null if there are no arguments.

max_returned_rows The maximum number of rows returned by the query.

Returns: The JSDataSet containing the results of the query.

serverName The name of the table's server.

tableName The table's name.

Returns: The datasource of the given table/server.

dataSource The datasource string to get the server name from.

Returns: The servername of the datasource.

dataSource The datasource string to get the tablename from.

Returns: The tablename of the datasource.

serverName The specified name of the database server connection.

Returns: A database product name.

Returns: Array of outstanding/unsaved JSRecords.

foundset return edited records in the foundset only.

Returns: Array of outstanding/unsaved JSRecords.

datasource the datasource for which to get the edited records

Returns: Array of outstanding/unsaved JSRecords

datasource the datasource for which to get the edited records

filter criteria against which the edited record must match to be included

Returns: Array of outstanding/unsaved JSRecords

Returns: Array of failed JSRecords

foundset return failed records in the foundset only.

Returns: Array of failed JSRecords

query The query to get the JSFoundset for.

Returns: A new JSFoundset with that query as its base query.

dataSource The datasource to get a JSFoundset for.

Returns: A new JSFoundset for that datasource.

serverName The servername to get a JSFoundset for.

tableName The tablename for that server

Returns: A new JSFoundset for that datasource.

foundset The JSFoundset to get the count for.

Returns: the foundset count

foundset The foundset to update.

Returns: The JSFoundsetUpdater for the specified JSFoundset.

dataSource The 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.

columnName The name of the column that has a sequence defined in its properties.

Returns: The next sequence for the column, null if there was no sequence for that column or if there is no column with the given name.

Returns: An Array of servernames.

foundset The foundset where the JSTable can be get from.

Returns: the JSTable get from the input.

record The record where the table can be get from.

Returns: the JSTable get from the input.

dataSource The datasource where the table can be get from.

Returns: the JSTable get from the input.

serverName Server name.

tableName Table name.

Returns: the JSTable get from the input.

dataSource Data where a server table can be get from. Can be a foundset, a datasource name or a JSTable.

Returns: the total table count.

serverName The name of the database server connection.

Returns: Two dimensional array.

serverName The name of the database server connection.

filterName The filter name for which to get the array.

Returns: Two dimensional array.

serverName The server name to get the table names from.

Returns: An Array with the tables names of that server.

name The name to lookup a ViewFoundSet for

Returns: A new ViewFoundSet for that query.

name The name given to this foundset (will create a datasource url like view:[name])

query The query to get the ViewFoundSet for.

Returns: A new ViewFoundSet for that query.

name The name given to this foundset (will create a datasource url like view:[name])

query The query to get the ViewFoundSet for.

register Register the created ViewFoundSet to the system so it can be used by forms.

Returns: A new JSFoundset for that query.

serverName The server name to get the view names from.

Returns: An Array with the view names of that server.

Returns: true if the current client has locks or the lock.

lockName The lock name to check.

Returns: true if the current client has locks or the lock.

foundset The JSFoundset to test.

Returns: true if the JSFoundset has new records or JSRecord is a new record.

foundset The JSFoundset to test.

index The record index in the foundset to test (not specified means has the foundset any new records)

Returns: true if the JSFoundset has new records or JSRecord is a new record.

foundset The JSFoundset to test if it has changes.

Returns: true if there are changes in the JSFoundset or JSRecord.

foundset The JSFoundset to test if it has changes.

index The record index in the foundset to test (not specified means has the foundset any changed records)

Returns: true if there are changes in the JSFoundset or JSRecord.

foundset A JSFoundset to test.

Returns: true if the foundset/relation has records.

record A JSRecord to test.

relationString The relation name.

Returns: true if the foundset/relation has records.

Returns: true if the client has a transaction.

sourceRecord The source JSRecord to copy from.

combinedDestinationRecord The target/destination JSRecord to copy into.

Returns: true if the records could me merged.

sourceRecord The source JSRecord to copy from.

combinedDestinationRecord The target/destination JSRecord to copy into.

columnNames The column names array that should be copied.

Returns: true if the records could me merged.

foundsetOrRecord JSFoundset or JSRecord to recalculate.

foundset The JSFoundset to refresh

index The index of the JSRecord that must be refreshed (or -1 for all).

Returns: true if the refresh was done.

Returns: true if all locks or the lock is released.

lockName The lock name to release.

Returns: true if all locks or the lock is released.

uri ;

Returns: true if the data source was successfully removed; false otherwise.

serverName The name of the database server connection.

filterName The name of the filter that should be removed.

Returns: true if the filter could be removed.

foundset A JSFoundset to revert.

rollbackEdited call rollbackEditedRecords() before rolling back the transaction

rollbackEdited call rollbackEditedRecords() before rolling back the transaction

revertSavedRecords if 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.

Returns: true if the save was done without an error.

foundset The JSFoundset to save.

Returns: true if the save was done without an error.

record The JSRecord to save.

Returns: true if the save was done without an error.

records The array of JSRecord to save.

Returns: true if the save was done without an error.

autoSave Boolean to enable or disable autosave.

Returns: false if the current edited record could not be saved.

filterName The name of the filter that should be set.

tableFilters list of filters to be applied.

Returns: true if the table filters could be applied.

sourceName The name of the source database server connection

destinationName The name of the destination database server connection.

Returns: true if the switch could be done.

record The record to validate.

Returns: Returns a JSRecordMarkers if the record has validation problems

record The record to validate.

customObject The extra customObject that is passed on the the validation methods.

Returns: a JSRecordMarkers object containing validation problems, or null if no validation issues were found.

SQL_ACTION_TYPES
JSColumn
JSDataSet
JSFoundSetUpdater
JSRecordMarker
JSRecordMarkers
JSRecord
JSFoundSet
JSTable
QBSelect
QBColumn
QBCase
QBCaseWhen
QBColumn
QBColumns
QBCondition
QBColumn
QBGroupBy
QBJoin
QBJoins
QBLogicalCondition
QBLogicalCondition
QBResult
QBColumn
QBSort
QBSorts
QBTableClause
QBPart
QBParameter
QBParameters
QBFunctions
QBAggregates
QUERY_COLUMN_TYPES
JSFoundSet
JSRecord
JSTableFilter
JSFoundSet
JSRecord
JSBaseRecord
JSBaseSQLRecord
JSFoundSet
JSFoundSet
Boolean
Boolean
Boolean
JSFoundSet
Number
Boolean
JSFoundSet
Number
String
Boolean
QBSelect
Boolean
QBSelect
String
Boolean
String
String
String
Object
Boolean
String
String
String
Object
String
Boolean
String
String
String
String
Object
Boolean
String
String
String
String
Object
String
Boolean
String
Object
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
JSFoundSet
JSFoundSet
JSFoundSet
JSFoundSet
String
JSFoundSet
JSFoundSet
JSDataSet
JSFoundSet
Array
JSDataSet
Array
JSDataSet
Array
Array
JSDataSet
String
JSDataSet
Object
JSRecord
Boolean
Object
JSRecord
Boolean
Boolean
Object
JSRecord
Array
Boolean
String
QBSelect
Boolean
Number
Array
Array
String
String
QBSelect
Number
String
String
QBSelect
Number
Array
String
String
QBSelect
Number
Array
Array
String
String
String
String
Array
Number
String
String
String
String
Array
Number
Array
String
String
String
String
Array
Number
Object
Array
String
JSDataSet
Number
Number
JSDataSet
Number
Array
JSDataSet
String
QBSelect
String
String
QBSelect
QBSelect
JSTableFilter
String
String
String
Object
JSTableFilter
String
String
String
String
Object
JSTableFilter
String
Boolean
String
Boolean
String
Boolean
Array
Boolean
String
Array
QBSelect
Boolean
Number
JSDataSet
QBSelect
Number
JSDataSet
String
String
Array
Number
JSDataSet
String
String
String
String
String
String
String
String
String
Array
JSFoundSet
Array
String
Array
String
Object
Array
Array
JSFoundSet
Array
QBSelect
JSFoundSet
String
JSFoundSet
String
String
JSFoundSet
JSFoundSet
Number
JSFoundSet
JSFoundSetUpdater
String
String
Object
Array
JSFoundSet
JSTable
JSRecord
JSTable
String
JSTable
String
String
JSTable
Object
Number
String
Array
String
String
Array
String
Array
String
JSFoundSet
String
QBSelect
JSFoundSet
String
QBSelect
Boolean
JSFoundSet
String
Array
Boolean
String
Boolean
JSFoundSet
Boolean
JSFoundSet
Number
Boolean
JSFoundSet
Boolean
JSFoundSet
Number
Boolean
JSFoundSet
Boolean
JSRecord
String
Boolean
Boolean
JSRecord
JSRecord
Boolean
JSRecord
JSRecord
Array
Boolean
Object
Object
Number
Boolean
Boolean
String
Boolean
String
Boolean
String
String
Boolean
JSFoundSet
Boolean
Boolean
Boolean
Boolean
JSFoundSet
Boolean
JSRecord
Boolean
Array
Boolean
Boolean
Boolean
String
Array
Boolean
String
String
Boolean
JSRecord
JSRecordMarkers
JSRecord
Object
JSRecordMarkers
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
JSFoundSet
JSFoundSet
JSDataSet
JSDataSet
JSDataSet
JSDataSet
JSDataSet
Boolean
Boolean
Boolean
String
String
String
String
String
String
String
JSDataSet
JSDataSet
JSDataSet
QBSelect
QBSelect
JSTableFilter
JSTableFilter
JSTableFilter
Boolean
Boolean
Array
JSDataSet
JSDataSet
JSDataSet
String
String
String
String
Array
Array
Array
Array
Array
Array
JSFoundSet
JSFoundSet
JSFoundSet
Number
JSFoundSetUpdater
Object
Array
JSTable
JSTable
JSTable
JSTable
Number
Array
Array
Array
JSFoundSet
JSFoundSet
JSFoundSet
Array
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
JSRecordMarkers
JSRecordMarkers
alwaysFollowPkSelection
disableRelatedSiblingsPrefetch
nullColumnValidatorEnabled
acquireLock(foundset, recordIndex)
acquireLock(foundset, recordIndex, lockName)
addTableFilterParam(query)
addTableFilterParam(query, filterName)
addTableFilterParam(datasource, dataprovider, operator, value)
addTableFilterParam(datasource, dataprovider, operator, value, filterName)
addTableFilterParam(serverName, tableName, dataprovider, operator, value)
addTableFilterParam(serverName, tableName, dataprovider, operator, value, filterName)
addTrackingInfo(columnName, value)
commitTransaction()
commitTransaction(saveFirst)
commitTransaction(saveFirst, revertSavedRecords)
convertFoundSet(foundset, related)
convertFoundSet(foundset, related)
convertToDataSet(foundset)
convertToDataSet(foundset, dataproviderNames)
convertToDataSet(values)
convertToDataSet(values, dataproviderNames)
convertToDataSet(ids)
copyMatchingFields(source, destination)
copyMatchingFields(source, destination, overwrite)
copyMatchingFields(source, destination, names)
createDataSourceByQuery(name, query, useTableFilters, max_returned_rows, types, pkNames)
createDataSourceByQuery(name, query, max_returned_rows)
createDataSourceByQuery(name, query, max_returned_rows, types)
createDataSourceByQuery(name, query, max_returned_rows, types, pkNames)
createDataSourceByQuery(name, server_name, sql_query, arguments, max_returned_rows)
createDataSourceByQuery(name, server_name, sql_query, arguments, max_returned_rows, types)
createDataSourceByQuery(name, server_name, sql_query, arguments, max_returned_rows, columnTypes, pkNames)
createEmptyDataSet()
createEmptyDataSet(rowCount, columnCount)
createEmptyDataSet(rowCount, columnNames)
createSelect(dataSource)
createSelect(dataSource, tableAlias)
createTableFilterParam(query)
createTableFilterParam(datasource, dataprovider, operator, value)
createTableFilterParam(serverName, tableName, dataprovider, operator, value)
dataSourceExists(dataSource)
flushCalculations(datasource, onlyUnstored)
flushCalculations(datasource, onlyUnstored, calcnames)
getAutoSave()
getDataModelClonesFrom(serverName)
getDataSetByQuery(query, useTableFilters, max_returned_rows)
getDataSetByQuery(query, max_returned_rows)
getDataSetByQuery(server_name, sql_query, arguments, max_returned_rows)
getDataSource(serverName, tableName)
getDataSourceServerName(dataSource)
getDataSourceTableName(dataSource)
getDatabaseProductName(serverName)
getEditedRecords()
getEditedRecords(foundset)
getEditedRecords(datasource)
getEditedRecords(datasource, filter)
getFailedRecords()
getFailedRecords(foundset)
getFoundSet(query)
getFoundSet(dataSource)
getFoundSet(serverName, tableName)
getFoundSetCount(foundset)
getFoundSetUpdater(foundset)
getNextSequence(dataSource, columnName)
getServerNames()
getTable(foundset)
getTable(record)
getTable(dataSource)
getTable(serverName, tableName)
getTableCount(dataSource)
getTableFilterParams(serverName)
getTableFilterParams(serverName, filterName)
getTableNames(serverName)
getViewFoundSet(name)
getViewFoundSet(name, query)
getViewFoundSet(name, query, register)
getViewNames(serverName)
hasLocks()
hasLocks(lockName)
hasNewRecords(foundset)
hasNewRecords(foundset, index)
hasRecordChanges(foundset)
hasRecordChanges(foundset, index)
hasRecords(foundset)
hasRecords(record, relationString)
hasTransaction()
mergeRecords(sourceRecord, combinedDestinationRecord)
mergeRecords(sourceRecord, combinedDestinationRecord, columnNames)
recalculate(foundsetOrRecord)
refreshRecordFromDatabase(foundset, index)
releaseAllLocks()
releaseAllLocks(lockName)
removeDataSource(uri)
removeTableFilterParam(serverName, filterName)
revertEditedRecords()
revertEditedRecords(foundset)
rollbackTransaction()
rollbackTransaction(rollbackEdited)
rollbackTransaction(rollbackEdited, revertSavedRecords)
saveData()
saveData(foundset)
saveData(record)
saveData(records)
setAutoSave(autoSave)
setCreateEmptyFormFoundsets()
setTableFilters(filterName, tableFilters)
startTransaction()
switchServer(sourceName, destinationName)
validate(record)
validate(record, customObject)