Child pages
  • JSRecord

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{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}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-showtd}{tr}{tr:id=ret}{td}*Returns*\\[ServoyException] -- The occurred exception.{td}{tr}{tr:id=retsee}{td}*ReturnsAlso see*\\{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=editdiv:class=sIndent}{div}{td}{tr}{tr:id=seelink}{td}*AlsoExternal seelinks*\\{sub-section:exception_see|text=|trigger=button}{sub-section}div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{sub-section:exception_see|trigger=none}{sub-sectioncode:language=javascript}
var exception = record.exception;
{code}{div}{td}{tr}{builder-show}{builder-show:permission=edittr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=foundset|class=node}{tr:id=linkname}{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-showh6.foundset{td}{tr}{tr:id=des}{td}Returns parent foundset of the record.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=samprs}{td}*SampleParameters*\\{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:id=ret}{td}*Returns*\\[JSFoundset] -- The parent foundset of the record.{td}{tr}{tr:classid=lastDetailRowsee}{td}{*Also see*\\{div:class=sIndent}{div}{td}{tr}{tbody}{tbodytr:id=foundset|class=node}{tr:id=name}{td}h6.foundsetlink}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=dessam}{td}{sub-section:foundset_des|text=|trigger=button}{sub-section}{sub-section:foundset_des|trigger=none|class=sIndent}Returns parent foundset of the record.{sub-section*Sample*\\{div:class=sIndent}{code:language=javascript}
var parent = record.foundset;
{code}{div}{td}{tr}{builder-showtr:permission=editclass=lastDetailRow}{td}{td}{tr:id=snc}{tbody}{tdtable}*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} 

{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}{builder-show}{trtr:id=retsig}{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{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}{builder-show:permission=edit}{tr:id=seedes}{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=editReturns 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().{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=linkprs}{td}*External linksParameters*\\{sub-section:foundset_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:foundset_link|trigger=none}{sub-section}{div}td}{tr}{tr:id=ret}{td}*Returns*\\[JSDataSet] -- a JSDataSet with the changed data of this record.{td}{tr}{builder-show}{tr:id=samsee}{td}*SampleAlso see*\\{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-sectiondiv:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:classid=lastDetailRowsam}{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*Sample*\\{div:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getChangedDatagetDataSource|class=node}{tr:id=name}{td}h6.getChangedDatagetDataSource{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSDataSetString]{span}{span:id=iets|style=float: left; font-weight: bold;}getChangedDatagetDataSource{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}Returns a JSDataSet with outstanding (not saved) changed dataReturns the records datasource string.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\[String] -- The datasource string 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{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=prssam}{td}*ParametersSample*\\{sub-section:getChangedData_prs|text=|trigger=button}{sub-section}{sub-section:getChangedData_prs|trigger=none|class=sIndent}{sub-sectiondiv:class=sIndent}{code:language=javascript}
var ds = record.getDataSource();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{builder-showtbody}{tbody:id=getPKs|class=node}{tr:id=retname}{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-sectionh6.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}{builder-showtr:permission=editid=des}{td}Returns an array with the primary key values of the record.{td}{tr}{tr:id=seesnc}{td}*Also seeSince*\\{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 Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*External linksReturns*\\\{sub-section:getChangedData_link|text=|trigger=button}{sub-section}[Object]\[] -- an Array with the pk values.{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{sub-section:getChangedData_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=samlink}{td}*SampleExternal links*\\{sub-section:getChangedData_sam|text=|trigger=button}{sub-section}div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{sub-section:getChangedData_sam|trigger=none}{code:language=javascript}
var datasetpks = recordfoundset.getChangedDatagetSelectedRecord()
for.getPKs() var// ialso =foundset.getRecord 1can ; i <= dataset.getMaxRowIndex() ; i++ )
{
	application.output(dataset.getValue(i,1) +' '+ dataset.getValue(i,2) +' '+ dataset.getValue(i,3));
}
{code}{sub-section}{be used
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getDataSourceisEditing|class=node}{tr:id=name}{td}h6.getDataSourceisEditing{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[StringBoolean]{span}{span:id=iets|style=float: left; font-weight: bold;}getDataSourceisEditing{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}Returns the records datasource string.{sub-section}{Returns true or false if the record is being edited or not.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{builder-show:permission=edit}{tr:id=sncprs}{td}*SinceParameters*\\{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=edittd}{tr}{tr:id=ret}{td}*Returns*\\[Boolean] -- a boolean when in edit.{td}{tr}{tr:id=prssee}{td}*ParametersAlso see*\\{sub-section:getDataSource_prs|text=|trigger=button}{sub-section}{sub-section:getDataSource_prs|trigger=none|div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{sub-sectiondiv}{td}{tr}{builder-show}{tr:id=retsam}{td}*ReturnsSample*\\{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-sectiondiv:class=sIndent}{code:language=javascript}
var isEditing = foundset.getSelectedRecord().isEditing() // also foundset.getRecord can be used
{code}{div}{td}{tr}{builder-showtr:permissionclass=editlastDetailRow}{tr:id=seetd}{td}*Also see*\\{sub-section:getDataSource_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getDataSource_see|trigger=none}{sub-section}{div}{tr}{tbody}{tbody:id=rollbackChanges|class=node}{tr:id=name}{td}h6.rollbackChanges{td}{tr}{builder-show}{builder-show:permission=edit}{trtr:id=linksig}{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{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=samdes}{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}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}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}{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.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\void{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{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}