{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\
{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[ServoyException]{td}{td}[#exception]
Returns last occurred exception on this record (or null).{td}{tr}{tbody}{tbody}{tr}{td}[JSFoundSet]{td}{td}[#foundset]
Returns parent foundset of the record.{td}{tr}{tbody}{table}\\
{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[JSDataSet]{td}{td}[#getChangedData]\()
Returns a JSDataSet with outstanding (not saved) changed data of this record.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getDataSource]\()
Returns the records datasource string.{td}{tr}{tbody}{tbody}{tr}{td}[Object]\[]{td}{td}[#getPKs]\()
Returns an array with the primary key values of the record.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isEditing]\()
Returns true or false if the record is being edited or not.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#rollbackChanges]\()
If this record exists in underlying datasource it will do a re\-query to fetch the latest data from the datasource.{td}{tr}{tbody}{table}\\
{table:id=property|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=exception|class=node}{tr:id=name}{td}h6.exception{td}{tr}{tr:id=des}{td}{sub-section:exception_des|text=|trigger=button}{sub-section}{sub-section:exception_des|trigger=none|class=sIndent}
Cache
index
true
refresh
100d
showRefresh
true
id
doc
title
Refresh page
showDate
true
retry
Enable
servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientsWordListMobileClientservoy sSummary12%30%58%height: 30px;3Property SummaryReturns last occurred exception on this record (or null).Returns parent foundset of the record.Returns the validation object if there where validation failures for this record Can be set to null again if you checked the problems, will also be set to null when a save was successful.servoy sSummary12%30%58%height: 30px;3Methods SummaryCreates and returns a new validation object for this record, which allows for markers to be used outside the validation flow.Returns a JSDataSet with outstanding (not saved) changed data of this record.Returns the records datasource string.Returns an array with the primary key values of the record.Returns true if the current record has outstanding/changed data.Returns true or false if the record is being edited or not.Returns true if the current record is a new record or false otherwise.Returns true or false if the related foundset is already loaded.voidReverts the in memory outstanding (not saved) changes of the record.propertyservoy sDetail2100%height:30px2Property Detailsexceptionname
exception
dessIndent
Returns last occurred exception on this record (or null).
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:exception_snc|text=|trigger=button}{sub-section}{sub-section:exception_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:exception_prs|text=|trigger=button}{sub-section}{sub-section:exception_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:exception_ret|text=|trigger=button}{sub-section}{sub-section:exception_ret|trigger=none|class=sIndent}[ServoyException] -- The occurred exception.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:exception_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:exception_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:exception_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:exception_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:exception_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:exception_sam|trigger=none}{code:language=javascript}
var exception = record.exception;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=foundset|class=node}{tr:id=name}{td}h6.foundset{td}{tr}{tr:id=des}{td}{sub-section:foundset_des|text=|trigger=button}{sub-section}{sub-section:foundset_des|trigger=none|class=sIndent}ret
Returns
sIndent The occurred exception.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowfoundsetname
foundset
dessIndent
Returns parent foundset of the record.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:foundset_snc|text=|trigger=button}{sub-section}{sub-section:foundset_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:foundset_prs|text=|trigger=button}{sub-section}{sub-section:foundset_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:foundset_ret|text=|trigger=button}{sub-section}{sub-section:foundset_ret|trigger=none|class=sIndent}[JSFoundset] -- The parent foundset of the record.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:foundset_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:foundset_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:foundset_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:foundset_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:foundset_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:foundset_sam|trigger=none}{code:language=javascript}
var parent = record.foundset;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\
{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getChangedData|class=node}{tr:id=name}{td}h6.getChangedData{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSDataSet]{span}{span:id=iets|style=float: left; font-weight: bold;}getChangedData{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getChangedData_des|text=|trigger=button}{sub-section}{sub-section:getChangedData_des|trigger=none|class=sIndent}ret
Returns the validation object if there where validation failures for this record
Can be set to null again if you checked the problems, will also be set to null when a save was successful.
ret
Returns
sIndent The last validation object if the record was not validated.clients
Creates and returns a new validation object for this record, which allows for markers to be used outside the validation flow.
Will overwrite the current markers if present.
Can be set to null again if you checked the problems, will also be set to null when a save was successful.
ret
Returns
sIndent A new validation object.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetChangedDataname
getChangedData()
dessIndent
Returns a JSDataSet with outstanding (not saved) changed data of this record.
column1 is the column name, colum2 is the old data and column3 is the new data.
NOTE: To return an array of records with outstanding changed data, see the function databaseManager.getEditedRecords().
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getChangedData_snc|text=|trigger=button}{sub-section}{sub-section:getChangedData_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getChangedData_prs|text=|trigger=button}{sub-section}{sub-section:getChangedData_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getChangedData_ret|text=|trigger=button}{sub-section}{sub-section:getChangedData_ret|trigger=none|class=sIndent}[JSDataSet] -- a JSDataSet with the changed data of this record.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getChangedData_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getChangedData_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getChangedData_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getChangedData_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getChangedData_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getChangedData_sam|trigger=none}{code:language=javascript}
var dataset = record.getChangedData()
for( var i = 1 ; i <= dataset.getMaxRowIndex() ; i++ )
{
application.output(dataset.getValue(i,1) +' '+ dataset.getValue(i,2) +' '+ dataset.getValue(i,3));
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getDataSource|class=node}{tr:id=name}{td}h6.getDataSource{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getDataSource{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getDataSource_des|text=|trigger=button}{sub-section}{sub-section:getDataSource_des|trigger=none|class=sIndent}ret
Returns
sIndent a JSDataSet with the changed data of this record.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetDataSourcename
getDataSource()
dessIndent
Returns the records datasource string.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getDataSource_snc|text=|trigger=button}{sub-section}{sub-section:getDataSource_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getDataSource_prs|text=|trigger=button}{sub-section}{sub-section:getDataSource_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getDataSource_ret|text=|trigger=button}{sub-section}{sub-section:getDataSource_ret|trigger=none|class=sIndent}[String] -- The datasource string of this record.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getDataSource_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDataSource_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getDataSource_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDataSource_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getDataSource_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDataSource_sam|trigger=none}{code:language=javascript}
var ds = record.getDataSource();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getPKs|class=node}{tr:id=name}{td}h6.getPKs{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getPKs{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getPKs_des|text=|trigger=button}{sub-section}{sub-section:getPKs_des|trigger=none|class=sIndent}ret
Returns
sIndent The datasource string of this record.clients
Returns an array with the primary key values of the record.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getPKs_snc|text=|trigger=button}{sub-section}{sub-section:getPKs_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getPKs_prs|text=|trigger=button}{sub-section}{sub-section:getPKs_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getPKs_ret|text=|trigger=button}{sub-section}{sub-section:getPKs_ret|trigger=none|class=sIndent}[Object]\[] -- an Array with the pk values.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getPKs_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getPKs_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getPKs_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getPKs_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getPKs_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getPKs_sam|trigger=none}{code:language=javascript}
var pks = foundset.getSelectedRecord().getPKs() // also foundset.getRecord can be used
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=isEditing|class=node}{tr:id=name}{td}h6.isEditing{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}isEditing{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:isEditing_des|text=|trigger=button}{sub-section}{sub-section:isEditing_des|trigger=none|class=sIndent}ret
Returns true if the current record has outstanding/changed data.
ret
Returns
sIndent true if the current record has outstanding/changed data.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowisEditingname
isEditing()
dessIndent
Returns true or false if the record is being edited or not.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:isEditing_snc|text=|trigger=button}{sub-section}{sub-section:isEditing_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:isEditing_prs|text=|trigger=button}{sub-section}{sub-section:isEditing_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:isEditing_ret|text=|trigger=button}{sub-section}{sub-section:isEditing_ret|trigger=none|class=sIndent}[Boolean] -- a boolean when in edit.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:isEditing_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:isEditing_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:isEditing_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:isEditing_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:isEditing_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:isEditing_sam|trigger=none}{code:language=javascript}
var isEditing = foundset.getSelectedRecord().isEditing() // also foundset.getRecord can be used
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=rollbackChanges|class=node}{tr:id=name}{td}h6.rollbackChanges{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}rollbackChanges{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:rollbackChanges_des|text=|trigger=button}{sub-section}{sub-section:rollbackChanges_des|trigger=none|class=sIndent}If this record exists in underlying datasource it will do a re\-query to fetch the latest data from the datasource.
NOTE: If you use transactions then it will be the data of your last update of this record in the transaction,
not the latest committed data of that record in the datasource.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:rollbackChanges_snc|text=|trigger=button}{sub-section}{sub-section:rollbackChanges_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:rollbackChanges_prs|text=|trigger=button}{sub-section}{sub-section:rollbackChanges_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:rollbackChanges_ret|text=|trigger=button}{sub-section}{sub-section:rollbackChanges_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:rollbackChanges_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:rollbackChanges_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:rollbackChanges_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:rollbackChanges_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:rollbackChanges_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:rollbackChanges_sam|trigger=none}{code:language=javascript}
var record= forms.customer.foundset.getSelectedRecord();
record.rollbackChanges();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
This will not check if the record doesn't really have any changes, it just returns the edit state.
So this can return true but databaseManager.getEditedRecord() will not return this record because that
call will check if the record has really any changed values compared to the stored database values.
Record can be in edit mode without changes when some field is focused (so edit is started) but no changes are done yet
or when changes were done in such a way that record data is the same as database data.