{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:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#multiSelect]
Get or set the multiSelect flag of the foundset.{td}{tr}{tbody}{table}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#addFoundSetFilterParam]\(dataprovider, operator, value, name)
Add a filter parameter that is permanent per user session to limit a specified foundset of records.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#clear]\()
Clear the foundset.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#deleteAllRecords]\()
Delete all records in foundset, resulting in empty foundset.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#deleteRecord]\(index)
Delete current record or the record under the given index.{td}{tr}{tbody}{tbody}{tr}{td}[JSFoundset]{td}{td}[#duplicateFoundSet]\()
Get a duplicate of the foundset.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#duplicateRecord]\(index, location, changeSelection)
Duplicate current record or record at index in the foundset.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#find]\()
Set the foundset in find mode.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getCurrentSort]\()
Get the current sort columns.{td}{tr}{tbody}{tbody}{tr}{td}Object{td}{td}[#getDataProviderValue]\(dataProviderID)
Get a value based on a dataprovider name.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getDataSource]\()
Get the datasource used.{td}{tr}{tbody}{tbody}{tr}{td}Object[][]{td}{td}[#getFoundSetFilterParams]\(filterName)
Get the list of previously defined foundset filters.{td}{tr}{tbody}{tbody}{tr}{td}[JSRecord]{td}{td}[#getRecord]\(index)
Get the record object at the index.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getRelationName]\()
Gets the relation name (null if not a related foundset).{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getSelectedIndex]\()
Get the current record index of the foundset.{td}{tr}{tbody}{tbody}{tr}{td}[Number]\[]{td}{td}[#getSelectedIndexes]\()
Get the selected records indexes.{td}{tr}{tbody}{tbody}{tr}{td}[JSRecord]{td}{td}[#getSelectedRecord]\()
Get the selected record.{td}{tr}{tbody}{tbody}{tr}{td}[JSRecord]\[]{td}{td}[#getSelectedRecords]\()
Get the selected records.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getSize]\()
Get the number of records in this foundset.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#invertRecords]\()
Invert the foundset against all rows of the current table.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isInFind]\()
Check if this foundset is in find mode.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#loadAllRecords]\()
Loads all accessible records from the datasource into the foundset.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#loadOmittedRecords]\()
Loads the records that are currently omitted as a foundset.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#loadRecords]\(input, queryArgumentsArray)
Load records with primary key (dataset/number/uuid) or query.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#newRecord]\(location, changeSelection)
Create a new record in the foundset.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#omitRecord]\(index)
Omit current record or the record under the given index, to be shown with loadOmittedRecords.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#relookup]\(index)
Perform a relookup for the current record or the record under the given index
Lookups are defined in the dataprovider (columns) auto-enter setting and are normally performed over a relation upon record creation.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#removeFoundSetFilterParam]\(name)
Remove a named foundset filter.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#search]\(clearLastResults, reduceSearch)
Perform a search and show the results.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#selectRecord]\(pkid1, pkid2, pkidn)
Select the record based on pk data.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setDataProviderValue]\(dataProviderID, value)
Set a value based on a dataprovider name.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setSelectedIndex]\(index)
Set the current record index.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setSelectedIndexes]\(indexes)
Set the selected records indexes.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#sort]\(sortString, defer)
Sorts the foundset based on the given sort string.{td}{tr}{tbody}{tbody}{tr}{td}[JSFoundset]{td}{td}[#unrelate]\()
Create a new unrelated foundset that is a copy of the current foundset.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=FACE87E0-3914-4357-B27C-332B449910F6}{tr:id=name}{td}h6.multiSelect{td}{tr}{tr:id=des}{td}{sub-section:FACE87E0-3914-4357-B27C-332B449910F6_des|text=|trigger=button}{sub-section}{sub-section:FACE87E0-3914-4357-B27C-332B449910F6_des|trigger=none|class=sIndent}Get or set the multiSelect flag of the foundset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:FACE87E0-3914-4357-B27C-332B449910F6_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FACE87E0-3914-4357-B27C-332B449910F6_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:FACE87E0-3914-4357-B27C-332B449910F6_ret|text=|trigger=button}{sub-section}{sub-section:FACE87E0-3914-4357-B27C-332B449910F6_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FACE87E0-3914-4357-B27C-332B449910F6_see|text=|trigger=button}{sub-section}{sub-section:FACE87E0-3914-4357-B27C-332B449910F6_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FACE87E0-3914-4357-B27C-332B449910F6_see|text=|trigger=button}{sub-section}{sub-section:FACE87E0-3914-4357-B27C-332B449910F6_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FACE87E0-3914-4357-B27C-332B449910F6_sam|text=|trigger=button}{sub-section}{sub-section:FACE87E0-3914-4357-B27C-332B449910F6_sam|class=sIndent|trigger=none}{code:language=javascript}
// allow user to select multiple rows.
forms.customer.foundset.multiSelect = true;
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=32CB8AB6-C397-4FF1-9278-1BA98C685A27}{tr:id=name}{td}h6.addFoundSetFilterParam{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}addFoundSetFilterParam{span}{span:id=iets|style=float: left;}\(dataprovider, operator, value, name){span}{td}{tr}{tr:id=des}{td}{sub-section:32CB8AB6-C397-4FF1-9278-1BA98C685A27_des|text=|trigger=button}{sub-section}{sub-section:32CB8AB6-C397-4FF1-9278-1BA98C685A27_des|trigger=none|class=sIndent}Add a filter parameter that is permanent per user session to limit a specified foundset of records.
Use clear() or loadAllRecords() to make the filter effective.
When given a name, the filter can be removed again using removeFoundSetFilterParam(name).{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:32CB8AB6-C397-4FF1-9278-1BA98C685A27_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:32CB8AB6-C397-4FF1-9278-1BA98C685A27_prs|trigger=none}dataprovider -- String column to filter on.
operator -- String operator: =, <, >, >=, <=, !=, LIKE, or IN.
value -- Object filter value.
\[name\] -- String name, can be used to remove the filter again.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:32CB8AB6-C397-4FF1-9278-1BA98C685A27_ret|text=|trigger=button}{sub-section}{sub-section:32CB8AB6-C397-4FF1-9278-1BA98C685A27_ret|trigger=none|class=sIndent}[Boolean] -- true if adding the filter succeeded, false otherwise.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:32CB8AB6-C397-4FF1-9278-1BA98C685A27_see|text=|trigger=button}{sub-section}{sub-section:32CB8AB6-C397-4FF1-9278-1BA98C685A27_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:32CB8AB6-C397-4FF1-9278-1BA98C685A27_see|text=|trigger=button}{sub-section}{sub-section:32CB8AB6-C397-4FF1-9278-1BA98C685A27_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:32CB8AB6-C397-4FF1-9278-1BA98C685A27_sam|text=|trigger=button}{sub-section}{sub-section:32CB8AB6-C397-4FF1-9278-1BA98C685A27_sam|class=sIndent|trigger=none}{code:language=javascript}
var success = forms.customer.foundset.addFoundSetFilterParam('customerid', '=', 'BLONP', 'custFilter');//possible to add multiple
forms.customer.foundset.loadAllRecords();//to make param(s) effective
// Named filters can be removed using forms.customer.foundset.removeFoundSetFilterParam(filterName)
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=AB1E6E30-BF31-48F9-8698-6472A910486C}{tr:id=name}{td}h6.clear{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}clear{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:AB1E6E30-BF31-48F9-8698-6472A910486C_des|text=|trigger=button}{sub-section}{sub-section:AB1E6E30-BF31-48F9-8698-6472A910486C_des|trigger=none|class=sIndent}Clear the foundset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:AB1E6E30-BF31-48F9-8698-6472A910486C_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:AB1E6E30-BF31-48F9-8698-6472A910486C_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:AB1E6E30-BF31-48F9-8698-6472A910486C_ret|text=|trigger=button}{sub-section}{sub-section:AB1E6E30-BF31-48F9-8698-6472A910486C_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:AB1E6E30-BF31-48F9-8698-6472A910486C_see|text=|trigger=button}{sub-section}{sub-section:AB1E6E30-BF31-48F9-8698-6472A910486C_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:AB1E6E30-BF31-48F9-8698-6472A910486C_see|text=|trigger=button}{sub-section}{sub-section:AB1E6E30-BF31-48F9-8698-6472A910486C_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:AB1E6E30-BF31-48F9-8698-6472A910486C_sam|text=|trigger=button}{sub-section}{sub-section:AB1E6E30-BF31-48F9-8698-6472A910486C_sam|class=sIndent|trigger=none}{code:language=javascript}
//Clear the foundset, including searches that may be on it
forms.customer.foundset.clear();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F7C3851A-2F3C-4EE8-8274-4307BE1780FE}{tr:id=name}{td}h6.deleteAllRecords{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}deleteAllRecords{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:F7C3851A-2F3C-4EE8-8274-4307BE1780FE_des|text=|trigger=button}{sub-section}{sub-section:F7C3851A-2F3C-4EE8-8274-4307BE1780FE_des|trigger=none|class=sIndent}Delete all records in foundset, resulting in empty foundset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:F7C3851A-2F3C-4EE8-8274-4307BE1780FE_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F7C3851A-2F3C-4EE8-8274-4307BE1780FE_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:F7C3851A-2F3C-4EE8-8274-4307BE1780FE_ret|text=|trigger=button}{sub-section}{sub-section:F7C3851A-2F3C-4EE8-8274-4307BE1780FE_ret|trigger=none|class=sIndent}[Boolean] -- boolean true if all records could be deleted.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F7C3851A-2F3C-4EE8-8274-4307BE1780FE_see|text=|trigger=button}{sub-section}{sub-section:F7C3851A-2F3C-4EE8-8274-4307BE1780FE_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F7C3851A-2F3C-4EE8-8274-4307BE1780FE_see|text=|trigger=button}{sub-section}{sub-section:F7C3851A-2F3C-4EE8-8274-4307BE1780FE_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F7C3851A-2F3C-4EE8-8274-4307BE1780FE_sam|text=|trigger=button}{sub-section}{sub-section:F7C3851A-2F3C-4EE8-8274-4307BE1780FE_sam|class=sIndent|trigger=none}{code:language=javascript}
var success = forms.customer.foundset.deleteAllRecords();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E11D5875-97DA-4876-B021-B83FE88025A5}{tr:id=name}{td}h6.deleteRecord{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}deleteRecord{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:E11D5875-97DA-4876-B021-B83FE88025A5_des|text=|trigger=button}{sub-section}{sub-section:E11D5875-97DA-4876-B021-B83FE88025A5_des|trigger=none|class=sIndent}Delete current record or the record under the given index.
If the foundset is in multiselect mode, all selected records are deleted (when no index parameter is used).{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:E11D5875-97DA-4876-B021-B83FE88025A5_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E11D5875-97DA-4876-B021-B83FE88025A5_prs|trigger=none}\[index\] -- index of record to delete.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:E11D5875-97DA-4876-B021-B83FE88025A5_ret|text=|trigger=button}{sub-section}{sub-section:E11D5875-97DA-4876-B021-B83FE88025A5_ret|trigger=none|class=sIndent}[Boolean] -- boolean true if all records could be deleted.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E11D5875-97DA-4876-B021-B83FE88025A5_see|text=|trigger=button}{sub-section}{sub-section:E11D5875-97DA-4876-B021-B83FE88025A5_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E11D5875-97DA-4876-B021-B83FE88025A5_see|text=|trigger=button}{sub-section}{sub-section:E11D5875-97DA-4876-B021-B83FE88025A5_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E11D5875-97DA-4876-B021-B83FE88025A5_sam|text=|trigger=button}{sub-section}{sub-section:E11D5875-97DA-4876-B021-B83FE88025A5_sam|class=sIndent|trigger=none}{code:language=javascript}
var success = forms.customer.foundset.deleteRecord();
//can return false incase of related foundset having records and orphans records are not allowed by the relation
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=CCE2973C-AE72-43CD-92A5-BB251F2E3085}{tr:id=name}{td}h6.duplicateFoundSet{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFoundset]{span}{span:id=iets|style=float: left; font-weight: bold;}duplicateFoundSet{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:CCE2973C-AE72-43CD-92A5-BB251F2E3085_des|text=|trigger=button}{sub-section}{sub-section:CCE2973C-AE72-43CD-92A5-BB251F2E3085_des|trigger=none|class=sIndent}Get a duplicate of the foundset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:CCE2973C-AE72-43CD-92A5-BB251F2E3085_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:CCE2973C-AE72-43CD-92A5-BB251F2E3085_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:CCE2973C-AE72-43CD-92A5-BB251F2E3085_ret|text=|trigger=button}{sub-section}{sub-section:CCE2973C-AE72-43CD-92A5-BB251F2E3085_ret|trigger=none|class=sIndent}[JSFoundset] -- foundset duplicate.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CCE2973C-AE72-43CD-92A5-BB251F2E3085_see|text=|trigger=button}{sub-section}{sub-section:CCE2973C-AE72-43CD-92A5-BB251F2E3085_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CCE2973C-AE72-43CD-92A5-BB251F2E3085_see|text=|trigger=button}{sub-section}{sub-section:CCE2973C-AE72-43CD-92A5-BB251F2E3085_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CCE2973C-AE72-43CD-92A5-BB251F2E3085_sam|text=|trigger=button}{sub-section}{sub-section:CCE2973C-AE72-43CD-92A5-BB251F2E3085_sam|class=sIndent|trigger=none}{code:language=javascript}
var dupFoundset = forms.customer.foundset.duplicateFoundSet();
forms.customer.foundset.find();
//search some fields
var count = forms.customer.foundset.search();
if (count == 0)
{
	plugins.dialogs.showWarningDialog('Alert', 'No records found','OK');
	controller.loadRecords(dupFoundset);
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=917021CA-62D4-4911-AAA4-DF28F47EBCA4}{tr:id=name}{td}h6.duplicateRecord{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}duplicateRecord{span}{span:id=iets|style=float: left;}\(index, location, changeSelection){span}{td}{tr}{tr:id=des}{td}{sub-section:917021CA-62D4-4911-AAA4-DF28F47EBCA4_des|text=|trigger=button}{sub-section}{sub-section:917021CA-62D4-4911-AAA4-DF28F47EBCA4_des|trigger=none|class=sIndent}Duplicate current record or record at index in the foundset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:917021CA-62D4-4911-AAA4-DF28F47EBCA4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:917021CA-62D4-4911-AAA4-DF28F47EBCA4_prs|trigger=none}\[index\] -- index of record to duplicate.
\[location\] -- boolean or number when true the new record is added as the topmost record, when a number, the new record is added at specified index
\[changeSelection\] -- boolean when true the selection is changed to the duplicated record
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:917021CA-62D4-4911-AAA4-DF28F47EBCA4_ret|text=|trigger=button}{sub-section}{sub-section:917021CA-62D4-4911-AAA4-DF28F47EBCA4_ret|trigger=none|class=sIndent}[Number] -- true if succesful{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:917021CA-62D4-4911-AAA4-DF28F47EBCA4_see|text=|trigger=button}{sub-section}{sub-section:917021CA-62D4-4911-AAA4-DF28F47EBCA4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:917021CA-62D4-4911-AAA4-DF28F47EBCA4_see|text=|trigger=button}{sub-section}{sub-section:917021CA-62D4-4911-AAA4-DF28F47EBCA4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:917021CA-62D4-4911-AAA4-DF28F47EBCA4_sam|text=|trigger=button}{sub-section}{sub-section:917021CA-62D4-4911-AAA4-DF28F47EBCA4_sam|class=sIndent|trigger=none}{code:language=javascript}
forms.customer.foundset.duplicateRecord();
forms.customer.foundset.duplicateRecord(false); //duplicate the current record, adds at bottom
forms.customer.foundset.duplicateRecord(1,2); //duplicate the first record as second record
//duplicates the record (record index 3), adds on top and selects the record
forms.customer.foundset.duplicateRecord(3,true,true);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=1F95E261-1254-4453-B4C7-31F7D2CC3EF0}{tr:id=name}{td}h6.find{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}find{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:1F95E261-1254-4453-B4C7-31F7D2CC3EF0_des|text=|trigger=button}{sub-section}{sub-section:1F95E261-1254-4453-B4C7-31F7D2CC3EF0_des|trigger=none|class=sIndent}Set the foundset in find mode.

Before going into find mode, all unsaved records will be saved in the database.
If this fails (due to validation failures or sql errors) or is not allowed (autosave off), 
the foundset will not go into find mode.
Note: always make sure to check the result of the find() method.

When in find mode, columns can be assigned string expressions that are evaluated as:
General:
      c1||c2    (condition1 or condition2)
      c|format  (apply format on condition like 'x|dd-MM-yyyy')
      !c        (not condition)
      #c        (modify condition, depends on column type)
      ^         (is null)
      ^=        (is null or empty/zero)
      &lt;x &gt;x &lt;=x &gt;=x  (comparison)
      x...y     (between values x and y, including values)
      x         (equals value x)
      
 Number fields:
      =x       (equals value x)
      ^=       (is null or zero)
      
 Date fields
      #c       (modify condition, match on entire day)
      now      (equals now, date and or time)
      //       (equals today)
      today    (equals today)
      
 Text fields:
      #c       (modify condition, case insensitive search)
      ^=       (is null or empty)
      %x%      (contains x)
      %x_y%    (contains x followed by any char and y)
      \\%      (contains char '%')
      \\_      (contains char '_'){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:1F95E261-1254-4453-B4C7-31F7D2CC3EF0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1F95E261-1254-4453-B4C7-31F7D2CC3EF0_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:1F95E261-1254-4453-B4C7-31F7D2CC3EF0_ret|text=|trigger=button}{sub-section}{sub-section:1F95E261-1254-4453-B4C7-31F7D2CC3EF0_ret|trigger=none|class=sIndent}[Boolean] -- true if the foundset is now in find mode, false otherwise.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1F95E261-1254-4453-B4C7-31F7D2CC3EF0_see|text=|trigger=button}{sub-section}{sub-section:1F95E261-1254-4453-B4C7-31F7D2CC3EF0_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1F95E261-1254-4453-B4C7-31F7D2CC3EF0_see|text=|trigger=button}{sub-section}{sub-section:1F95E261-1254-4453-B4C7-31F7D2CC3EF0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1F95E261-1254-4453-B4C7-31F7D2CC3EF0_sam|text=|trigger=button}{sub-section}{sub-section:1F95E261-1254-4453-B4C7-31F7D2CC3EF0_sam|class=sIndent|trigger=none}{code:language=javascript}
if (forms.customer.foundset.find()) //find will fail if autosave is disabled and there are unsaved records
{
	columnTextDataProvider = 'a search value'
	columnNumberDataProvider = '>10'
	forms.customer.foundset.search()
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D2290BD4-BAF8-4D58-A456-A76087958E32}{tr:id=name}{td}h6.getCurrentSort{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getCurrentSort{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:D2290BD4-BAF8-4D58-A456-A76087958E32_des|text=|trigger=button}{sub-section}{sub-section:D2290BD4-BAF8-4D58-A456-A76087958E32_des|trigger=none|class=sIndent}Get the current sort columns.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:D2290BD4-BAF8-4D58-A456-A76087958E32_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D2290BD4-BAF8-4D58-A456-A76087958E32_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:D2290BD4-BAF8-4D58-A456-A76087958E32_ret|text=|trigger=button}{sub-section}{sub-section:D2290BD4-BAF8-4D58-A456-A76087958E32_ret|trigger=none|class=sIndent}[String] -- String sort columns{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D2290BD4-BAF8-4D58-A456-A76087958E32_see|text=|trigger=button}{sub-section}{sub-section:D2290BD4-BAF8-4D58-A456-A76087958E32_see|class=sIndent|trigger=none}[.sort|JSFoundset#sort]\\{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D2290BD4-BAF8-4D58-A456-A76087958E32_see|text=|trigger=button}{sub-section}{sub-section:D2290BD4-BAF8-4D58-A456-A76087958E32_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D2290BD4-BAF8-4D58-A456-A76087958E32_sam|text=|trigger=button}{sub-section}{sub-section:D2290BD4-BAF8-4D58-A456-A76087958E32_sam|class=sIndent|trigger=none}{code:language=javascript}
//reverse the current sort

//the original sort "companyName asc, companyContact desc"
//the inversed sort "companyName desc, companyContact asc"
var foundsetSort = foundset.getCurrentSort()
var sortColumns = foundsetSort.split(',')
var newFoundsetSort = ''
for(var i=0; i<sortColumns.length; i++)
{
	var currentSort = sortColumns[i]
	var sortType = currentSort.substring(currentSort.length-3)
	if(sortType.equalsIgnoreCase('asc'))
	{
		newFoundsetSort += currentSort.replace(' asc', ' desc')
	}
	else
	{
		newFoundsetSort += currentSort.replace(' desc', ' asc')
	}
	if(i != sortColumns.length - 1)
	{
		newFoundsetSort += ','
	}
}
foundset.sort(newFoundsetSort)
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=246BA706-91FF-4CAD-925D-2E95077649FC}{tr:id=name}{td}h6.getDataProviderValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object{span}{span:id=iets|style=float: left; font-weight: bold;}getDataProviderValue{span}{span:id=iets|style=float: left;}\(dataProviderID){span}{td}{tr}{tr:id=des}{td}{sub-section:246BA706-91FF-4CAD-925D-2E95077649FC_des|text=|trigger=button}{sub-section}{sub-section:246BA706-91FF-4CAD-925D-2E95077649FC_des|trigger=none|class=sIndent}Get a value based on a dataprovider name.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:246BA706-91FF-4CAD-925D-2E95077649FC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:246BA706-91FF-4CAD-925D-2E95077649FC_prs|trigger=none}dataProviderID -- data provider name
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:246BA706-91FF-4CAD-925D-2E95077649FC_ret|text=|trigger=button}{sub-section}{sub-section:246BA706-91FF-4CAD-925D-2E95077649FC_ret|trigger=none|class=sIndent}Object -- Object value{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:246BA706-91FF-4CAD-925D-2E95077649FC_see|text=|trigger=button}{sub-section}{sub-section:246BA706-91FF-4CAD-925D-2E95077649FC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:246BA706-91FF-4CAD-925D-2E95077649FC_see|text=|trigger=button}{sub-section}{sub-section:246BA706-91FF-4CAD-925D-2E95077649FC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:246BA706-91FF-4CAD-925D-2E95077649FC_sam|text=|trigger=button}{sub-section}{sub-section:246BA706-91FF-4CAD-925D-2E95077649FC_sam|class=sIndent|trigger=none}{code:language=javascript}
var val = forms.customer.foundset.getDataProviderValue('contact_name');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E03ED030-5B23-42B3-9AD9-C37869924EA0}{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:E03ED030-5B23-42B3-9AD9-C37869924EA0_des|text=|trigger=button}{sub-section}{sub-section:E03ED030-5B23-42B3-9AD9-C37869924EA0_des|trigger=none|class=sIndent}Get the datasource used.
The datasource is an url that describes the data source.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:E03ED030-5B23-42B3-9AD9-C37869924EA0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E03ED030-5B23-42B3-9AD9-C37869924EA0_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:E03ED030-5B23-42B3-9AD9-C37869924EA0_ret|text=|trigger=button}{sub-section}{sub-section:E03ED030-5B23-42B3-9AD9-C37869924EA0_ret|trigger=none|class=sIndent}[String] -- String data source.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E03ED030-5B23-42B3-9AD9-C37869924EA0_see|text=|trigger=button}{sub-section}{sub-section:E03ED030-5B23-42B3-9AD9-C37869924EA0_see|class=sIndent|trigger=none}[databaseManager.getDataSourceServerName|Database Manager#getDataSourceServerName]\\[databaseManager.getDataSourceTableName|Database Manager#getDataSourceTableName]\\{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E03ED030-5B23-42B3-9AD9-C37869924EA0_see|text=|trigger=button}{sub-section}{sub-section:E03ED030-5B23-42B3-9AD9-C37869924EA0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E03ED030-5B23-42B3-9AD9-C37869924EA0_sam|text=|trigger=button}{sub-section}{sub-section:E03ED030-5B23-42B3-9AD9-C37869924EA0_sam|class=sIndent|trigger=none}{code:language=javascript}
var dataSource = forms.customer.foundset.getDataSource();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=15CFB250-4157-46F4-84A8-5E477D80747A}{tr:id=name}{td}h6.getFoundSetFilterParams{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object[][]{span}{span:id=iets|style=float: left; font-weight: bold;}getFoundSetFilterParams{span}{span:id=iets|style=float: left;}\(filterName){span}{td}{tr}{tr:id=des}{td}{sub-section:15CFB250-4157-46F4-84A8-5E477D80747A_des|text=|trigger=button}{sub-section}{sub-section:15CFB250-4157-46F4-84A8-5E477D80747A_des|trigger=none|class=sIndent}Get the list of previously defined foundset filters.
The result is an array of:
\[ tableName, dataprovider, operator, value, name ]{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:15CFB250-4157-46F4-84A8-5E477D80747A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:15CFB250-4157-46F4-84A8-5E477D80747A_prs|trigger=none}\[filterName\] -- name of the filters to retrieve, get all if not specified.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:15CFB250-4157-46F4-84A8-5E477D80747A_ret|text=|trigger=button}{sub-section}{sub-section:15CFB250-4157-46F4-84A8-5E477D80747A_ret|trigger=none|class=sIndent}Object[][] -- Array of filter definitions.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:15CFB250-4157-46F4-84A8-5E477D80747A_see|text=|trigger=button}{sub-section}{sub-section:15CFB250-4157-46F4-84A8-5E477D80747A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:15CFB250-4157-46F4-84A8-5E477D80747A_see|text=|trigger=button}{sub-section}{sub-section:15CFB250-4157-46F4-84A8-5E477D80747A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:15CFB250-4157-46F4-84A8-5E477D80747A_sam|text=|trigger=button}{sub-section}{sub-section:15CFB250-4157-46F4-84A8-5E477D80747A_sam|class=sIndent|trigger=none}{code:language=javascript}
var params = foundset.getFoundSetFilterParams()
for (var i = 0; params != null && i < params.length; i++)
{
	application.output('FoundSet filter on table ' + params[i][0]+ ': '+ params[i][1]+ ' '+params[i][2]+ ' '+params[i][3] +(params[i][4] == null ? ' [no name]' : ' ['+params[i][4]+']'))
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=9B4F6C80-0D57-4BF4-974C-8E1801A62469}{tr:id=name}{td}h6.getRecord{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSRecord]{span}{span:id=iets|style=float: left; font-weight: bold;}getRecord{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:9B4F6C80-0D57-4BF4-974C-8E1801A62469_des|text=|trigger=button}{sub-section}{sub-section:9B4F6C80-0D57-4BF4-974C-8E1801A62469_des|trigger=none|class=sIndent}Get the record object at the index.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:9B4F6C80-0D57-4BF4-974C-8E1801A62469_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:9B4F6C80-0D57-4BF4-974C-8E1801A62469_prs|trigger=none}index -- int record index
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:9B4F6C80-0D57-4BF4-974C-8E1801A62469_ret|text=|trigger=button}{sub-section}{sub-section:9B4F6C80-0D57-4BF4-974C-8E1801A62469_ret|trigger=none|class=sIndent}[JSRecord] -- Record record.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:9B4F6C80-0D57-4BF4-974C-8E1801A62469_see|text=|trigger=button}{sub-section}{sub-section:9B4F6C80-0D57-4BF4-974C-8E1801A62469_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:9B4F6C80-0D57-4BF4-974C-8E1801A62469_see|text=|trigger=button}{sub-section}{sub-section:9B4F6C80-0D57-4BF4-974C-8E1801A62469_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:9B4F6C80-0D57-4BF4-974C-8E1801A62469_sam|text=|trigger=button}{sub-section}{sub-section:9B4F6C80-0D57-4BF4-974C-8E1801A62469_sam|class=sIndent|trigger=none}{code:language=javascript}
var record = forms.customer.foundset.getRecord(index);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=ED4275E5-8252-45C7-A2E5-6ED92541F1D4}{tr:id=name}{td}h6.getRelationName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getRelationName{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:ED4275E5-8252-45C7-A2E5-6ED92541F1D4_des|text=|trigger=button}{sub-section}{sub-section:ED4275E5-8252-45C7-A2E5-6ED92541F1D4_des|trigger=none|class=sIndent}Gets the relation name (null if not a related foundset).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:ED4275E5-8252-45C7-A2E5-6ED92541F1D4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:ED4275E5-8252-45C7-A2E5-6ED92541F1D4_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:ED4275E5-8252-45C7-A2E5-6ED92541F1D4_ret|text=|trigger=button}{sub-section}{sub-section:ED4275E5-8252-45C7-A2E5-6ED92541F1D4_ret|trigger=none|class=sIndent}[String] -- String relation name when related.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:ED4275E5-8252-45C7-A2E5-6ED92541F1D4_see|text=|trigger=button}{sub-section}{sub-section:ED4275E5-8252-45C7-A2E5-6ED92541F1D4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:ED4275E5-8252-45C7-A2E5-6ED92541F1D4_see|text=|trigger=button}{sub-section}{sub-section:ED4275E5-8252-45C7-A2E5-6ED92541F1D4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:ED4275E5-8252-45C7-A2E5-6ED92541F1D4_sam|text=|trigger=button}{sub-section}{sub-section:ED4275E5-8252-45C7-A2E5-6ED92541F1D4_sam|class=sIndent|trigger=none}{code:language=javascript}
var relName = forms.customer.foundset.getRelationName();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B4CABC04-03E8-4D58-887C-AF07EBF66466}{tr:id=name}{td}h6.getSelectedIndex{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getSelectedIndex{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:B4CABC04-03E8-4D58-887C-AF07EBF66466_des|text=|trigger=button}{sub-section}{sub-section:B4CABC04-03E8-4D58-887C-AF07EBF66466_des|trigger=none|class=sIndent}Get the current record index of the foundset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:B4CABC04-03E8-4D58-887C-AF07EBF66466_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B4CABC04-03E8-4D58-887C-AF07EBF66466_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:B4CABC04-03E8-4D58-887C-AF07EBF66466_ret|text=|trigger=button}{sub-section}{sub-section:B4CABC04-03E8-4D58-887C-AF07EBF66466_ret|trigger=none|class=sIndent}[Number] -- int current index (1-based){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B4CABC04-03E8-4D58-887C-AF07EBF66466_see|text=|trigger=button}{sub-section}{sub-section:B4CABC04-03E8-4D58-887C-AF07EBF66466_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B4CABC04-03E8-4D58-887C-AF07EBF66466_see|text=|trigger=button}{sub-section}{sub-section:B4CABC04-03E8-4D58-887C-AF07EBF66466_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B4CABC04-03E8-4D58-887C-AF07EBF66466_sam|text=|trigger=button}{sub-section}{sub-section:B4CABC04-03E8-4D58-887C-AF07EBF66466_sam|class=sIndent|trigger=none}{code:language=javascript}
//gets the current record index in the current foundset
var current = forms.customer.foundset.getSelectedIndex();
//sets the next record in the foundset
forms.customer.foundset.setSelectedIndex(current+1);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E00870C1-3D00-4A50-9215-953BC349264C}{tr:id=name}{td}h6.getSelectedIndexes{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getSelectedIndexes{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:E00870C1-3D00-4A50-9215-953BC349264C_des|text=|trigger=button}{sub-section}{sub-section:E00870C1-3D00-4A50-9215-953BC349264C_des|trigger=none|class=sIndent}Get the selected records indexes.
When the founset is in multiSelect mode (see property multiSelect), selection can be a more than 1 index.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:E00870C1-3D00-4A50-9215-953BC349264C_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E00870C1-3D00-4A50-9215-953BC349264C_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:E00870C1-3D00-4A50-9215-953BC349264C_ret|text=|trigger=button}{sub-section}{sub-section:E00870C1-3D00-4A50-9215-953BC349264C_ret|trigger=none|class=sIndent}[Number]\[] -- Array current indexes (1-based){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E00870C1-3D00-4A50-9215-953BC349264C_see|text=|trigger=button}{sub-section}{sub-section:E00870C1-3D00-4A50-9215-953BC349264C_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E00870C1-3D00-4A50-9215-953BC349264C_see|text=|trigger=button}{sub-section}{sub-section:E00870C1-3D00-4A50-9215-953BC349264C_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E00870C1-3D00-4A50-9215-953BC349264C_sam|text=|trigger=button}{sub-section}{sub-section:E00870C1-3D00-4A50-9215-953BC349264C_sam|class=sIndent|trigger=none}{code:language=javascript}
var current = forms.customer.foundset.getSelectedIndexes();
var newSelection = new Array();
newSelection[0] = current[0];
forms.customer.foundset.setSelectedIndexes(newSelection);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=EB10D513-9AB5-4147-AB2D-E5699D926093}{tr:id=name}{td}h6.getSelectedRecord{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSRecord]{span}{span:id=iets|style=float: left; font-weight: bold;}getSelectedRecord{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:EB10D513-9AB5-4147-AB2D-E5699D926093_des|text=|trigger=button}{sub-section}{sub-section:EB10D513-9AB5-4147-AB2D-E5699D926093_des|trigger=none|class=sIndent}Get the selected record.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:EB10D513-9AB5-4147-AB2D-E5699D926093_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:EB10D513-9AB5-4147-AB2D-E5699D926093_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:EB10D513-9AB5-4147-AB2D-E5699D926093_ret|text=|trigger=button}{sub-section}{sub-section:EB10D513-9AB5-4147-AB2D-E5699D926093_ret|trigger=none|class=sIndent}[JSRecord] -- Record record.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:EB10D513-9AB5-4147-AB2D-E5699D926093_see|text=|trigger=button}{sub-section}{sub-section:EB10D513-9AB5-4147-AB2D-E5699D926093_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:EB10D513-9AB5-4147-AB2D-E5699D926093_see|text=|trigger=button}{sub-section}{sub-section:EB10D513-9AB5-4147-AB2D-E5699D926093_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:EB10D513-9AB5-4147-AB2D-E5699D926093_sam|text=|trigger=button}{sub-section}{sub-section:EB10D513-9AB5-4147-AB2D-E5699D926093_sam|class=sIndent|trigger=none}{code:language=javascript}
var selectedRecord = forms.customer.foundset.getSelectedRecord();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=1590B384-F5EA-42B0-990D-D2F1CD91C7E5}{tr:id=name}{td}h6.getSelectedRecords{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSRecord]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getSelectedRecords{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:1590B384-F5EA-42B0-990D-D2F1CD91C7E5_des|text=|trigger=button}{sub-section}{sub-section:1590B384-F5EA-42B0-990D-D2F1CD91C7E5_des|trigger=none|class=sIndent}Get the selected records.
When the founset is in multiSelect mode (see property multiSelect), selection can be a more than 1 record.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:1590B384-F5EA-42B0-990D-D2F1CD91C7E5_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1590B384-F5EA-42B0-990D-D2F1CD91C7E5_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:1590B384-F5EA-42B0-990D-D2F1CD91C7E5_ret|text=|trigger=button}{sub-section}{sub-section:1590B384-F5EA-42B0-990D-D2F1CD91C7E5_ret|trigger=none|class=sIndent}[JSRecord]\[] -- Array current records.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1590B384-F5EA-42B0-990D-D2F1CD91C7E5_see|text=|trigger=button}{sub-section}{sub-section:1590B384-F5EA-42B0-990D-D2F1CD91C7E5_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1590B384-F5EA-42B0-990D-D2F1CD91C7E5_see|text=|trigger=button}{sub-section}{sub-section:1590B384-F5EA-42B0-990D-D2F1CD91C7E5_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1590B384-F5EA-42B0-990D-D2F1CD91C7E5_sam|text=|trigger=button}{sub-section}{sub-section:1590B384-F5EA-42B0-990D-D2F1CD91C7E5_sam|class=sIndent|trigger=none}{code:language=javascript}
var selectedRecords = forms.customer.foundset.getSelectedRecords();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=9ADA6E2A-24EE-426A-9378-EF13118451F9}{tr:id=name}{td}h6.getSize{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getSize{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:9ADA6E2A-24EE-426A-9378-EF13118451F9_des|text=|trigger=button}{sub-section}{sub-section:9ADA6E2A-24EE-426A-9378-EF13118451F9_des|trigger=none|class=sIndent}Get the number of records in this foundset.
This is the number of records loaded, note that when looping over a foundset, size() may
increase as more records are loaded.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:9ADA6E2A-24EE-426A-9378-EF13118451F9_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:9ADA6E2A-24EE-426A-9378-EF13118451F9_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:9ADA6E2A-24EE-426A-9378-EF13118451F9_ret|text=|trigger=button}{sub-section}{sub-section:9ADA6E2A-24EE-426A-9378-EF13118451F9_ret|trigger=none|class=sIndent}[Number] -- int current size.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:9ADA6E2A-24EE-426A-9378-EF13118451F9_see|text=|trigger=button}{sub-section}{sub-section:9ADA6E2A-24EE-426A-9378-EF13118451F9_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:9ADA6E2A-24EE-426A-9378-EF13118451F9_see|text=|trigger=button}{sub-section}{sub-section:9ADA6E2A-24EE-426A-9378-EF13118451F9_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:9ADA6E2A-24EE-426A-9378-EF13118451F9_sam|text=|trigger=button}{sub-section}{sub-section:9ADA6E2A-24EE-426A-9378-EF13118451F9_sam|class=sIndent|trigger=none}{code:language=javascript}
var nrRecords = forms.customer.foundset.getSize()

// to loop over foundset, recalculate size for each record
	for (var i = 1; i <= forms.customer.foundset.getSize(); i++)
	{
		var rec = forms.customer.foundset.getRecord(i);
	}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E780B6B2-51AD-445C-969E-9A0ACFD18BEA}{tr:id=name}{td}h6.invertRecords{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}invertRecords{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:E780B6B2-51AD-445C-969E-9A0ACFD18BEA_des|text=|trigger=button}{sub-section}{sub-section:E780B6B2-51AD-445C-969E-9A0ACFD18BEA_des|trigger=none|class=sIndent}Invert the foundset against all rows of the current table.
All records that are not in the foundset will become the current foundset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:E780B6B2-51AD-445C-969E-9A0ACFD18BEA_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E780B6B2-51AD-445C-969E-9A0ACFD18BEA_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:E780B6B2-51AD-445C-969E-9A0ACFD18BEA_ret|text=|trigger=button}{sub-section}{sub-section:E780B6B2-51AD-445C-969E-9A0ACFD18BEA_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E780B6B2-51AD-445C-969E-9A0ACFD18BEA_see|text=|trigger=button}{sub-section}{sub-section:E780B6B2-51AD-445C-969E-9A0ACFD18BEA_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E780B6B2-51AD-445C-969E-9A0ACFD18BEA_see|text=|trigger=button}{sub-section}{sub-section:E780B6B2-51AD-445C-969E-9A0ACFD18BEA_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E780B6B2-51AD-445C-969E-9A0ACFD18BEA_sam|text=|trigger=button}{sub-section}{sub-section:E780B6B2-51AD-445C-969E-9A0ACFD18BEA_sam|class=sIndent|trigger=none}{code:language=javascript}
forms.customer.foundset.invertRecords();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=7EE5BDC2-00CC-43F8-95F7-06A5F92A988D}{tr:id=name}{td}h6.isInFind{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}isInFind{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:7EE5BDC2-00CC-43F8-95F7-06A5F92A988D_des|text=|trigger=button}{sub-section}{sub-section:7EE5BDC2-00CC-43F8-95F7-06A5F92A988D_des|trigger=none|class=sIndent}Check if this foundset is in find mode.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:7EE5BDC2-00CC-43F8-95F7-06A5F92A988D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:7EE5BDC2-00CC-43F8-95F7-06A5F92A988D_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:7EE5BDC2-00CC-43F8-95F7-06A5F92A988D_ret|text=|trigger=button}{sub-section}{sub-section:7EE5BDC2-00CC-43F8-95F7-06A5F92A988D_ret|trigger=none|class=sIndent}[Boolean] -- boolean is in find mode.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:7EE5BDC2-00CC-43F8-95F7-06A5F92A988D_see|text=|trigger=button}{sub-section}{sub-section:7EE5BDC2-00CC-43F8-95F7-06A5F92A988D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:7EE5BDC2-00CC-43F8-95F7-06A5F92A988D_see|text=|trigger=button}{sub-section}{sub-section:7EE5BDC2-00CC-43F8-95F7-06A5F92A988D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:7EE5BDC2-00CC-43F8-95F7-06A5F92A988D_sam|text=|trigger=button}{sub-section}{sub-section:7EE5BDC2-00CC-43F8-95F7-06A5F92A988D_sam|class=sIndent|trigger=none}{code:language=javascript}
//Returns true when find was called on this foundset and search has not been called yet
forms.customer.foundset.isInFind();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=88C803EC-C8FB-4A11-856F-492ED7C93E86}{tr:id=name}{td}h6.loadAllRecords{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}loadAllRecords{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:88C803EC-C8FB-4A11-856F-492ED7C93E86_des|text=|trigger=button}{sub-section}{sub-section:88C803EC-C8FB-4A11-856F-492ED7C93E86_des|trigger=none|class=sIndent}Loads all accessible records from the datasource into the foundset.
Filters on the foundset are applied.

Before loading the records, all unsaved records will be saved in the database.
If this fails (due to validation failures or sql errors) or is not allowed (autosave off), 
records will not be loaded,{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:88C803EC-C8FB-4A11-856F-492ED7C93E86_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:88C803EC-C8FB-4A11-856F-492ED7C93E86_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:88C803EC-C8FB-4A11-856F-492ED7C93E86_ret|text=|trigger=button}{sub-section}{sub-section:88C803EC-C8FB-4A11-856F-492ED7C93E86_ret|trigger=none|class=sIndent}[Boolean] -- true if records are loaded, false otherwise.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:88C803EC-C8FB-4A11-856F-492ED7C93E86_see|text=|trigger=button}{sub-section}{sub-section:88C803EC-C8FB-4A11-856F-492ED7C93E86_see|class=sIndent|trigger=none}[.addFoundSetFilterParam|JSFoundset#addFoundSetFilterParam]\\{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:88C803EC-C8FB-4A11-856F-492ED7C93E86_see|text=|trigger=button}{sub-section}{sub-section:88C803EC-C8FB-4A11-856F-492ED7C93E86_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:88C803EC-C8FB-4A11-856F-492ED7C93E86_sam|text=|trigger=button}{sub-section}{sub-section:88C803EC-C8FB-4A11-856F-492ED7C93E86_sam|class=sIndent|trigger=none}{code:language=javascript}
forms.customer.foundset.loadAllRecords();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F61F366F-1914-46DA-8844-DB0445836FA7}{tr:id=name}{td}h6.loadOmittedRecords{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}loadOmittedRecords{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:F61F366F-1914-46DA-8844-DB0445836FA7_des|text=|trigger=button}{sub-section}{sub-section:F61F366F-1914-46DA-8844-DB0445836FA7_des|trigger=none|class=sIndent}Loads the records that are currently omitted as a foundset.

Before loading the omitted records, all unsaved records will be saved in the database.
If this fails (due to validation failures or sql errors) or is not allowed (autosave off), 
omitted records will not be loaded,{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:F61F366F-1914-46DA-8844-DB0445836FA7_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F61F366F-1914-46DA-8844-DB0445836FA7_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:F61F366F-1914-46DA-8844-DB0445836FA7_ret|text=|trigger=button}{sub-section}{sub-section:F61F366F-1914-46DA-8844-DB0445836FA7_ret|trigger=none|class=sIndent}[Boolean] -- true if records are loaded, false otherwise.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F61F366F-1914-46DA-8844-DB0445836FA7_see|text=|trigger=button}{sub-section}{sub-section:F61F366F-1914-46DA-8844-DB0445836FA7_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F61F366F-1914-46DA-8844-DB0445836FA7_see|text=|trigger=button}{sub-section}{sub-section:F61F366F-1914-46DA-8844-DB0445836FA7_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F61F366F-1914-46DA-8844-DB0445836FA7_sam|text=|trigger=button}{sub-section}{sub-section:F61F366F-1914-46DA-8844-DB0445836FA7_sam|class=sIndent|trigger=none}{code:language=javascript}
forms.customer.foundset.loadOmittedRecords();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=5A46A52E-5F3D-4470-9671-903CE87B3C8F}{tr:id=name}{td}h6.loadRecords{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}loadRecords{span}{span:id=iets|style=float: left;}\(input, queryArgumentsArray){span}{td}{tr}{tr:id=des}{td}{sub-section:5A46A52E-5F3D-4470-9671-903CE87B3C8F_des|text=|trigger=button}{sub-section}{sub-section:5A46A52E-5F3D-4470-9671-903CE87B3C8F_des|trigger=none|class=sIndent}Load records with primary key (dataset/number/uuid) or query.

Load records can be used in 5 different ways
1) to copy foundset data from another foundset
foundset.loadRecords(fs);

2) to load a primary key dataset, will remove related sort!
var dataset = databaseManager.getDataSetByQuery(...);
foundset.loadRecords(dataset);

3) to load a single record by primary key, will remove related sort! (pk should be a number or UUID)
foundset.loadRecords(123);
foundset.loadRecords(application.getUUID('6b5e2f5d-047e-45b3-80ee-3a32267b1f20'));

4) to reload all last related records again, if for example when searched in tabpanel
foundset.loadRecords();

5) to load records in to the form based on a query (also known as 'Form by query')
foundset.loadRecords(sqlstring,parameters);
limitations/requirements for sqlstring are:
-must start with 'select'
-the selected columns must be the (Servoy Form) table primary key columns (alphabetically ordered like 'select a_id, b_id,c_id ...')
-can contain '?' which are replaced with values from the array supplied to parameters argument
if the sqlstring contains an 'order by' clause, the records will be sorted accordingly and additional constraints apply:
-must contain 'from' keyword
-the 'from' must be a comma separated list of table names
-must at least select from the table used in Servoy Form
-cannot contain 'group by', 'having' or 'union'
-all columns must be fully qualified like 'orders.order_id'{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:5A46A52E-5F3D-4470-9671-903CE87B3C8F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:5A46A52E-5F3D-4470-9671-903CE87B3C8F_prs|trigger=none}\[input\] -- foundset/pkdataset/single_pk/query
\[queryArgumentsArray\] -- used when input is a query
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:5A46A52E-5F3D-4470-9671-903CE87B3C8F_ret|text=|trigger=button}{sub-section}{sub-section:5A46A52E-5F3D-4470-9671-903CE87B3C8F_ret|trigger=none|class=sIndent}[Boolean] -- true if successful{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:5A46A52E-5F3D-4470-9671-903CE87B3C8F_see|text=|trigger=button}{sub-section}{sub-section:5A46A52E-5F3D-4470-9671-903CE87B3C8F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:5A46A52E-5F3D-4470-9671-903CE87B3C8F_see|text=|trigger=button}{sub-section}{sub-section:5A46A52E-5F3D-4470-9671-903CE87B3C8F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:5A46A52E-5F3D-4470-9671-903CE87B3C8F_sam|text=|trigger=button}{sub-section}{sub-section:5A46A52E-5F3D-4470-9671-903CE87B3C8F_sam|class=sIndent|trigger=none}{code:language=javascript}
//Load records can be used in 5 different ways
//1) to copy foundset data from another foundset
//forms.customer.foundset.loadRecords(fs);

//2) to load a primary key dataset, will remove related sort!
//var dataset = databaseManager.getDataSetByQuery(...);
// dataset must match the table primary key columns (alphabetically ordered)
//forms.customer.foundset.loadRecords(dataset);

//3) to load a single record by primary key, will remove related sort! (pk should be a number or UUID)
//forms.customer.foundset.loadRecords(123);
//forms.customer.foundset.loadRecords(application.getUUID('6b5e2f5d-047e-45b3-80ee-3a32267b1f20'));

//4) to reload all last related records again, if for example when searched in tabpanel
//forms.customer.foundset.loadRecords();

//5) to load records in to the form based on a query (also known as 'Form by query')
//forms.customer.foundset.loadRecords(sqlstring,parameters);
//limitations/requirements for sqlstring are:
//-must start with 'select'
//-the selected columns must be the (Servoy Form) table primary key columns (alphabetically ordered like 'select a_id, b_id,c_id ...')
//-can contain '?' which are replaced with values from the array supplied to parameters argument
//if the sqlstring contains an 'order by' clause, the records will be sorted accordingly and additional constraints apply:
//-must contain 'from' keyword
//-the 'from' must be a comma separated list of table names
//-must at least select from the table used in Servoy Form
//-cannot contain 'group by', 'having' or 'union'
//-all columns must be fully qualified like 'orders.order_id'
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=8BC6C66D-DF2E-438B-A2F1-E5996A7E522E}{tr:id=name}{td}h6.newRecord{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}newRecord{span}{span:id=iets|style=float: left;}\(location, changeSelection){span}{td}{tr}{tr:id=des}{td}{sub-section:8BC6C66D-DF2E-438B-A2F1-E5996A7E522E_des|text=|trigger=button}{sub-section}{sub-section:8BC6C66D-DF2E-438B-A2F1-E5996A7E522E_des|trigger=none|class=sIndent}Create a new record in the foundset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:8BC6C66D-DF2E-438B-A2F1-E5996A7E522E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8BC6C66D-DF2E-438B-A2F1-E5996A7E522E_prs|trigger=none}\[location\] -- boolean or number when true the new record is added as the topmost record, when a number, the new record is added at specified index
\[changeSelection\] -- boolean when true the selection is changed to the new record
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:8BC6C66D-DF2E-438B-A2F1-E5996A7E522E_ret|text=|trigger=button}{sub-section}{sub-section:8BC6C66D-DF2E-438B-A2F1-E5996A7E522E_ret|trigger=none|class=sIndent}[Number] -- int index of new record.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8BC6C66D-DF2E-438B-A2F1-E5996A7E522E_see|text=|trigger=button}{sub-section}{sub-section:8BC6C66D-DF2E-438B-A2F1-E5996A7E522E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8BC6C66D-DF2E-438B-A2F1-E5996A7E522E_see|text=|trigger=button}{sub-section}{sub-section:8BC6C66D-DF2E-438B-A2F1-E5996A7E522E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8BC6C66D-DF2E-438B-A2F1-E5996A7E522E_sam|text=|trigger=button}{sub-section}{sub-section:8BC6C66D-DF2E-438B-A2F1-E5996A7E522E_sam|class=sIndent|trigger=none}{code:language=javascript}
forms.customer.foundset.newRecord();
//forms.customer.foundset.newRecord(2); //adds as second record
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B7C85BA2-18B2-4993-AE3E-46ED58ACD19F}{tr:id=name}{td}h6.omitRecord{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}omitRecord{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:B7C85BA2-18B2-4993-AE3E-46ED58ACD19F_des|text=|trigger=button}{sub-section}{sub-section:B7C85BA2-18B2-4993-AE3E-46ED58ACD19F_des|trigger=none|class=sIndent}Omit current record or the record under the given index, to be shown with loadOmittedRecords.
If the foundset is in multiselect mode, all selected records are omitted (when no index parameter is used).

Note: The omitted records list is discarded when these functions are executed: loadAllRecords, loadRecords(dataset), loadRecords(sqlstring), invertRecords(){sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:B7C85BA2-18B2-4993-AE3E-46ED58ACD19F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B7C85BA2-18B2-4993-AE3E-46ED58ACD19F_prs|trigger=none}\[index\] -- index of record to omit.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:B7C85BA2-18B2-4993-AE3E-46ED58ACD19F_ret|text=|trigger=button}{sub-section}{sub-section:B7C85BA2-18B2-4993-AE3E-46ED58ACD19F_ret|trigger=none|class=sIndent}[Boolean] -- boolean true if all records could be omitted.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B7C85BA2-18B2-4993-AE3E-46ED58ACD19F_see|text=|trigger=button}{sub-section}{sub-section:B7C85BA2-18B2-4993-AE3E-46ED58ACD19F_see|class=sIndent|trigger=none}[.loadOmittedRecords|JSFoundset#loadOmittedRecords]\\{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B7C85BA2-18B2-4993-AE3E-46ED58ACD19F_see|text=|trigger=button}{sub-section}{sub-section:B7C85BA2-18B2-4993-AE3E-46ED58ACD19F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B7C85BA2-18B2-4993-AE3E-46ED58ACD19F_sam|text=|trigger=button}{sub-section}{sub-section:B7C85BA2-18B2-4993-AE3E-46ED58ACD19F_sam|class=sIndent|trigger=none}{code:language=javascript}
var success = forms.customer.foundset.omitRecord();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B00568D8-256F-44AE-A643-887E7BFA5AA9}{tr:id=name}{td}h6.relookup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}relookup{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:B00568D8-256F-44AE-A643-887E7BFA5AA9_des|text=|trigger=button}{sub-section}{sub-section:B00568D8-256F-44AE-A643-887E7BFA5AA9_des|trigger=none|class=sIndent}Perform a relookup for the current record or the record under the given index
Lookups are defined in the dataprovider (columns) auto-enter setting and are normally performed over a relation upon record creation.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:B00568D8-256F-44AE-A643-887E7BFA5AA9_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B00568D8-256F-44AE-A643-887E7BFA5AA9_prs|trigger=none}\[index\] -- record index (1-based)
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:B00568D8-256F-44AE-A643-887E7BFA5AA9_ret|text=|trigger=button}{sub-section}{sub-section:B00568D8-256F-44AE-A643-887E7BFA5AA9_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B00568D8-256F-44AE-A643-887E7BFA5AA9_see|text=|trigger=button}{sub-section}{sub-section:B00568D8-256F-44AE-A643-887E7BFA5AA9_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B00568D8-256F-44AE-A643-887E7BFA5AA9_see|text=|trigger=button}{sub-section}{sub-section:B00568D8-256F-44AE-A643-887E7BFA5AA9_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B00568D8-256F-44AE-A643-887E7BFA5AA9_sam|text=|trigger=button}{sub-section}{sub-section:B00568D8-256F-44AE-A643-887E7BFA5AA9_sam|class=sIndent|trigger=none}{code:language=javascript}
forms.customer.foundset.relookup(1);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A3DBE333-8954-4D08-8E16-A2EE998F8040}{tr:id=name}{td}h6.removeFoundSetFilterParam{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}removeFoundSetFilterParam{span}{span:id=iets|style=float: left;}\(name){span}{td}{tr}{tr:id=des}{td}{sub-section:A3DBE333-8954-4D08-8E16-A2EE998F8040_des|text=|trigger=button}{sub-section}{sub-section:A3DBE333-8954-4D08-8E16-A2EE998F8040_des|trigger=none|class=sIndent}Remove a named foundset filter.
Use clear() or loadAllRecords() to make the filter effective.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:A3DBE333-8954-4D08-8E16-A2EE998F8040_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A3DBE333-8954-4D08-8E16-A2EE998F8040_prs|trigger=none}name -- String filter name.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:A3DBE333-8954-4D08-8E16-A2EE998F8040_ret|text=|trigger=button}{sub-section}{sub-section:A3DBE333-8954-4D08-8E16-A2EE998F8040_ret|trigger=none|class=sIndent}[Boolean] -- true if removing the filter succeeded, false otherwise.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A3DBE333-8954-4D08-8E16-A2EE998F8040_see|text=|trigger=button}{sub-section}{sub-section:A3DBE333-8954-4D08-8E16-A2EE998F8040_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A3DBE333-8954-4D08-8E16-A2EE998F8040_see|text=|trigger=button}{sub-section}{sub-section:A3DBE333-8954-4D08-8E16-A2EE998F8040_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A3DBE333-8954-4D08-8E16-A2EE998F8040_sam|text=|trigger=button}{sub-section}{sub-section:A3DBE333-8954-4D08-8E16-A2EE998F8040_sam|class=sIndent|trigger=none}{code:language=javascript}
var success = forms.customer.foundset.removeFoundSetFilterParam('custFilter');// removes all filters with this name
forms.customer.foundset.loadAllRecords();//to make param(s) effective
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=74565EC1-08F8-4B22-9B91-1E5B9F7D12BC}{tr:id=name}{td}h6.search{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}search{span}{span:id=iets|style=float: left;}\(clearLastResults, reduceSearch){span}{td}{tr}{tr:id=des}{td}{sub-section:74565EC1-08F8-4B22-9B91-1E5B9F7D12BC_des|text=|trigger=button}{sub-section}{sub-section:74565EC1-08F8-4B22-9B91-1E5B9F7D12BC_des|trigger=none|class=sIndent}Perform a search and show the results.
Must be in find mode when running search (see find()).{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:74565EC1-08F8-4B22-9B91-1E5B9F7D12BC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:74565EC1-08F8-4B22-9B91-1E5B9F7D12BC_prs|trigger=none}\[clearLastResults\] -- boolean, clear previous search, default true
\[reduceSearch\] -- boolean, reduce (true) or extend (false) previous search results, default true
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:74565EC1-08F8-4B22-9B91-1E5B9F7D12BC_ret|text=|trigger=button}{sub-section}{sub-section:74565EC1-08F8-4B22-9B91-1E5B9F7D12BC_ret|trigger=none|class=sIndent}[Number] -- int number of rows returned{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:74565EC1-08F8-4B22-9B91-1E5B9F7D12BC_see|text=|trigger=button}{sub-section}{sub-section:74565EC1-08F8-4B22-9B91-1E5B9F7D12BC_see|class=sIndent|trigger=none}[.find|JSFoundset#find]\\{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:74565EC1-08F8-4B22-9B91-1E5B9F7D12BC_see|text=|trigger=button}{sub-section}{sub-section:74565EC1-08F8-4B22-9B91-1E5B9F7D12BC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:74565EC1-08F8-4B22-9B91-1E5B9F7D12BC_sam|text=|trigger=button}{sub-section}{sub-section:74565EC1-08F8-4B22-9B91-1E5B9F7D12BC_sam|class=sIndent|trigger=none}{code:language=javascript}
var recordCount = forms.customer.foundset.search();
//var recordCount = forms.customer.foundset.search(false,false);//to extend foundset
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=06AAD198-1E05-4A21-AB47-35EE2215AD6A}{tr:id=name}{td}h6.selectRecord{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}selectRecord{span}{span:id=iets|style=float: left;}\(pkid1, pkid2, pkidn){span}{td}{tr}{tr:id=des}{td}{sub-section:06AAD198-1E05-4A21-AB47-35EE2215AD6A_des|text=|trigger=button}{sub-section}{sub-section:06AAD198-1E05-4A21-AB47-35EE2215AD6A_des|trigger=none|class=sIndent}Select the record based on pk data.
Note that if the foundset has not loaded the record with the pk, selectrecord will fail.

In case of a table with a composite key, the pk sequence must match the alphabetical 
ordering of the pk column names.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:06AAD198-1E05-4A21-AB47-35EE2215AD6A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:06AAD198-1E05-4A21-AB47-35EE2215AD6A_prs|trigger=none}pkid1 -- primary key
\[pkid2\] -- second primary key (in case of composite primary key)
\[pkidn\] -- nth primary key
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:06AAD198-1E05-4A21-AB47-35EE2215AD6A_ret|text=|trigger=button}{sub-section}{sub-section:06AAD198-1E05-4A21-AB47-35EE2215AD6A_ret|trigger=none|class=sIndent}[Boolean] -- true if succeeded.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:06AAD198-1E05-4A21-AB47-35EE2215AD6A_see|text=|trigger=button}{sub-section}{sub-section:06AAD198-1E05-4A21-AB47-35EE2215AD6A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:06AAD198-1E05-4A21-AB47-35EE2215AD6A_see|text=|trigger=button}{sub-section}{sub-section:06AAD198-1E05-4A21-AB47-35EE2215AD6A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:06AAD198-1E05-4A21-AB47-35EE2215AD6A_sam|text=|trigger=button}{sub-section}{sub-section:06AAD198-1E05-4A21-AB47-35EE2215AD6A_sam|class=sIndent|trigger=none}{code:language=javascript}
forms.customer.foundset.selectRecord(pkid1,pkid2,pkidn);//pks must be alphabetically set! It is also possible to use an array as parameter.
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=CBE1B53A-C735-4DB1-A677-AF87B1977C42}{tr:id=name}{td}h6.setDataProviderValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setDataProviderValue{span}{span:id=iets|style=float: left;}\(dataProviderID, value){span}{td}{tr}{tr:id=des}{td}{sub-section:CBE1B53A-C735-4DB1-A677-AF87B1977C42_des|text=|trigger=button}{sub-section}{sub-section:CBE1B53A-C735-4DB1-A677-AF87B1977C42_des|trigger=none|class=sIndent}Set a value based on a dataprovider name.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:CBE1B53A-C735-4DB1-A677-AF87B1977C42_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:CBE1B53A-C735-4DB1-A677-AF87B1977C42_prs|trigger=none}dataProviderID -- data provider name
value -- value to set
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:CBE1B53A-C735-4DB1-A677-AF87B1977C42_ret|text=|trigger=button}{sub-section}{sub-section:CBE1B53A-C735-4DB1-A677-AF87B1977C42_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CBE1B53A-C735-4DB1-A677-AF87B1977C42_see|text=|trigger=button}{sub-section}{sub-section:CBE1B53A-C735-4DB1-A677-AF87B1977C42_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CBE1B53A-C735-4DB1-A677-AF87B1977C42_see|text=|trigger=button}{sub-section}{sub-section:CBE1B53A-C735-4DB1-A677-AF87B1977C42_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CBE1B53A-C735-4DB1-A677-AF87B1977C42_sam|text=|trigger=button}{sub-section}{sub-section:CBE1B53A-C735-4DB1-A677-AF87B1977C42_sam|class=sIndent|trigger=none}{code:language=javascript}
forms.customer.foundset.setDataProviderValue('contact_name','mycompany');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=9815BA08-3009-4EE0-A122-8165862F61F3}{tr:id=name}{td}h6.setSelectedIndex{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setSelectedIndex{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:9815BA08-3009-4EE0-A122-8165862F61F3_des|text=|trigger=button}{sub-section}{sub-section:9815BA08-3009-4EE0-A122-8165862F61F3_des|trigger=none|class=sIndent}Set the current record index.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:9815BA08-3009-4EE0-A122-8165862F61F3_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:9815BA08-3009-4EE0-A122-8165862F61F3_prs|trigger=none}index -- int index to set (1-based)
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:9815BA08-3009-4EE0-A122-8165862F61F3_ret|text=|trigger=button}{sub-section}{sub-section:9815BA08-3009-4EE0-A122-8165862F61F3_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:9815BA08-3009-4EE0-A122-8165862F61F3_see|text=|trigger=button}{sub-section}{sub-section:9815BA08-3009-4EE0-A122-8165862F61F3_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:9815BA08-3009-4EE0-A122-8165862F61F3_see|text=|trigger=button}{sub-section}{sub-section:9815BA08-3009-4EE0-A122-8165862F61F3_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:9815BA08-3009-4EE0-A122-8165862F61F3_sam|text=|trigger=button}{sub-section}{sub-section:9815BA08-3009-4EE0-A122-8165862F61F3_sam|class=sIndent|trigger=none}{code:language=javascript}
//gets the current record index in the current foundset
var current = forms.customer.foundset.getSelectedIndex();
//sets the next record in the foundset
forms.customer.foundset.setSelectedIndex(current+1);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8}{tr:id=name}{td}h6.setSelectedIndexes{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setSelectedIndexes{span}{span:id=iets|style=float: left;}\(indexes){span}{td}{tr}{tr:id=des}{td}{sub-section:CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8_des|text=|trigger=button}{sub-section}{sub-section:CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8_des|trigger=none|class=sIndent}Set the selected records indexes.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8_prs|trigger=none}indexes -- An array with indexes to set.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8_ret|text=|trigger=button}{sub-section}{sub-section:CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8_see|text=|trigger=button}{sub-section}{sub-section:CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8_see|text=|trigger=button}{sub-section}{sub-section:CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8_sam|text=|trigger=button}{sub-section}{sub-section:CEB8E7DD-67B9-4C9A-9DDF-CC29E4B56AB8_sam|class=sIndent|trigger=none}{code:language=javascript}
var current = forms.customer.foundset.getSelectedIndexes();
var newSelection = new Array();
newSelection[0] = current[0];
forms.customer.foundset.setSelectedIndexes(newSelection);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B2BD139B-71EB-4C6E-BA35-200A91256D6E}{tr:id=name}{td}h6.sort{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}sort{span}{span:id=iets|style=float: left;}\(sortString, defer){span}{td}{tr}{tr:id=des}{td}{sub-section:B2BD139B-71EB-4C6E-BA35-200A91256D6E_des|text=|trigger=button}{sub-section}{sub-section:B2BD139B-71EB-4C6E-BA35-200A91256D6E_des|trigger=none|class=sIndent}Sorts the foundset based on the given sort string. 
TIP: You can use the Copy button in the developer Select Sorting Fields dialog to get the needed syntax string for the desired sort fields/order.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:B2BD139B-71EB-4C6E-BA35-200A91256D6E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B2BD139B-71EB-4C6E-BA35-200A91256D6E_prs|trigger=none}sortString -- the specified columns (and sort order)
\[defer\] -- boolean when true, the "sortString" will be just stored, without performing a query on the database (the actual sorting will be deferred until the next data loading action).
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:B2BD139B-71EB-4C6E-BA35-200A91256D6E_ret|text=|trigger=button}{sub-section}{sub-section:B2BD139B-71EB-4C6E-BA35-200A91256D6E_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B2BD139B-71EB-4C6E-BA35-200A91256D6E_see|text=|trigger=button}{sub-section}{sub-section:B2BD139B-71EB-4C6E-BA35-200A91256D6E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B2BD139B-71EB-4C6E-BA35-200A91256D6E_see|text=|trigger=button}{sub-section}{sub-section:B2BD139B-71EB-4C6E-BA35-200A91256D6E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B2BD139B-71EB-4C6E-BA35-200A91256D6E_sam|text=|trigger=button}{sub-section}{sub-section:B2BD139B-71EB-4C6E-BA35-200A91256D6E_sam|class=sIndent|trigger=none}{code:language=javascript}
forms.customer.foundset.sort('columnA desc,columnB asc');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=DB2C8D88-6794-4161-AF2A-3EA3A847A2E3}{tr:id=name}{td}h6.unrelate{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFoundset]{span}{span:id=iets|style=float: left; font-weight: bold;}unrelate{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:DB2C8D88-6794-4161-AF2A-3EA3A847A2E3_des|text=|trigger=button}{sub-section}{sub-section:DB2C8D88-6794-4161-AF2A-3EA3A847A2E3_des|trigger=none|class=sIndent}Create a new unrelated foundset that is a copy of the current foundset.
If the current foundset is not related, no copy will made.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:DB2C8D88-6794-4161-AF2A-3EA3A847A2E3_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DB2C8D88-6794-4161-AF2A-3EA3A847A2E3_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:DB2C8D88-6794-4161-AF2A-3EA3A847A2E3_ret|text=|trigger=button}{sub-section}{sub-section:DB2C8D88-6794-4161-AF2A-3EA3A847A2E3_ret|trigger=none|class=sIndent}[JSFoundset] -- FoundSet unrelated foundset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DB2C8D88-6794-4161-AF2A-3EA3A847A2E3_see|text=|trigger=button}{sub-section}{sub-section:DB2C8D88-6794-4161-AF2A-3EA3A847A2E3_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DB2C8D88-6794-4161-AF2A-3EA3A847A2E3_see|text=|trigger=button}{sub-section}{sub-section:DB2C8D88-6794-4161-AF2A-3EA3A847A2E3_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:DB2C8D88-6794-4161-AF2A-3EA3A847A2E3_sam|text=|trigger=button}{sub-section}{sub-section:DB2C8D88-6794-4161-AF2A-3EA3A847A2E3_sam|class=sIndent|trigger=none}{code:language=javascript}
forms.customer.foundset.unrelate();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}