Child pages
  • JSFoundSet

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Div
styledisplay:none

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.

Div
iddescription
A JSFoundset is a scriptable object, it contains record objects defined by its SQL. It does lazy load the PKs and records.
Each foundset has its own record set and selected index



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
alldataproviders
Get all dataproviders of the foundset.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
multiSelect
Get or set the multiSelect flag of the foundset.



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
addFoundSetFilterParam(dataprovider, operator, value)
Add a filter parameter that is permanent per user session to limit a specified foundset of records.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
addFoundSetFilterParam(dataprovider, operator, value, name)
Add a filter parameter that is permanent per user session to limit a specified foundset of records.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
clear()
Clear the foundset.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
deleteAllRecords()
Delete all records in foundset, resulting in empty foundset.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
deleteRecord()
Delete currently selected record(s).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
deleteRecord(record)
Delete record from foundset.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
deleteRecord(index)
Delete record with the given index.
Table Row (tr)
Table Cell (td)
JSFoundSet
Table Cell (td)
duplicateFoundSet()
Get a duplicate of the foundset.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
duplicateRecord()
Duplicate current record, change selection to new record, place on top.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
duplicateRecord(onTop)
Duplicate selected record, change selection to new record.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
duplicateRecord(onTop, changeSelection)
Duplicate selected record.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
duplicateRecord(index)
Duplicate record at index in the foundset, change selection to new record, place on top.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
duplicateRecord(index, onTop)
Duplicate record at index in the foundset, change selection to new record.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
duplicateRecord(index, onTop, changeSelection)
Duplicate record at index in the foundset.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
duplicateRecord(index, location)
Duplicate record at index in the foundset, change selection to new record.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
duplicateRecord(index, location, changeSelection)
Duplicate record at index in the foundset.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
find()
Set the foundset in find mode.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getCurrentSort()
Get the current sort columns.
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
getDataProviderValue(dataProviderID)
Get a value based on a dataprovider name.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getDataSource()
Get the datasource used.
Table Row (tr)
Table Cell (td)
Object[][]
Table Cell (td)
getFoundSetFilterParams()
Get the list of previously defined foundset filters.
Table Row (tr)
Table Cell (td)
Object[][]
Table Cell (td)
getFoundSetFilterParams(filterName)
Get a previously defined foundset filter, using its given name.
Table Row (tr)
Table Cell (td)
QBSelect
Table Cell (td)
getQuery()
Get the query that the foundset is currently using.
Table Row (tr)
Table Cell (td)
JSRecord
Table Cell (td)
getRecord(index)
Get the record object at the index.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
getRecordIndex(record)
Get the record index.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getRelationName()
Gets the relation name (null if not a related foundset).
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
getSelectedIndex()
Get the current record index of the foundset.
Table Row (tr)
Table Cell (td)
Number[]
Table Cell (td)
getSelectedIndexes()
Get the indexes of the selected records.
Table Row (tr)
Table Cell (td)
JSRecord
Table Cell (td)
getSelectedRecord()
Get the selected record.
Table Row (tr)
Table Cell (td)
JSRecord[]
Table Cell (td)
getSelectedRecords()
Get the selected records.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
getSize()
Get the number of records in this foundset.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
hasConditions()
Check wether the foundset has any conditions from a previous find action.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
invertRecords()
Invert the foundset against all rows of the current table.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
isInFind()
Check if this foundset is in find mode.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
loadAllRecords()
Loads all accessible records from the datasource into the foundset.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
loadOmittedRecords()
Loads the records that are currently omitted as a foundset.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
loadRecords()
Reloads all last (related) records again, if, for example, after search in tabpanel.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
loadRecords(foundset)
Copies foundset data from another foundset.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
loadRecords(dataset)
Loads a primary key dataset, will remove related sort.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
loadRecords(querybuilder)
Loads records into form foundset based on a query builder object (also known as 'Form by query').
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
loadRecords(uuidpk)
Loads a single record by primary key, will remove related sort.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
loadRecords(numberpk)
Loads a single record by primary key, will remove related sort.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
loadRecords(queryString)
Loads records into form foundset based on a query (also known as 'Form by query').
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
loadRecords(queryString, argumentsArray)
Loads records into form foundset based on a query (also known as 'Form by query').
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
newRecord()
Create a new record on top of the foundset and change selection to it.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
newRecord(onTop)
Create a new record in the foundset and change selection to it.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
newRecord(onTop, changeSelection)
Create a new record in the foundset.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
newRecord(index)
Create a new record in the foundset and change selection to it.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
newRecord(index, changeSelection)
Create a new record in the foundset.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
omitRecord()
Omit current record, to be shown with loadOmittedRecords.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
omitRecord(index)
Omit record under the given index, to be shown with loadOmittedRecords.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
relookup()
Perform a relookup for the currently selected records
Lookups are defined in the dataprovider (columns) auto-enter setting and are normally performed over a relation upon record creation.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
relookup(index)
Perform a relookup for 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.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
removeFoundSetFilterParam(name)
Remove a named foundset filter.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
search()
Start the database search and use the results, returns the number of records, make sure you did "find" function first.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
search(clearLastResults)
Start the database search and use the results, returns the number of records, make sure you did "find" function first.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
search(clearLastResults, reduceSearch)
Start the database search and use the results, returns the number of records, make sure you did "find" function first.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
selectRecord(pkid1, [pkid2], [pkidn])
Select the record based on pk data.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
setDataProviderValue(dataProviderID, value)
Set a value based on a dataprovider name.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
setSelectedIndex(index)
Set the current record index.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
setSelectedIndexes(indexes)
Set the selected records indexes.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
sort(sortString)
Sorts the foundset based on the given sort string.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
sort(sortString, defer)
Sorts the foundset based on the given sort string.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
sort(recordComparisonFunction)
Sorts the foundset based on the given record comparator function.
Table Row (tr)
Table Cell (td)
JSFoundSet
Table Cell (td)
unrelate()
Create a new unrelated foundset that is a copy of the current foundset.



HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Details
Table Body (tbody)
idalldataproviders
Table Row (tr)
idname
Table Cell (td)

alldataproviders

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get all dataproviders of the foundset.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var dataprovidersNames = forms.customer.alldataproviders;
application.output("This foundset has " + dataprovidersNames.length + " data providers.")
for (var i=0; i<dataprovidersNames.length; i++)
	application.output(dataprovidersNames[i]);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idmultiSelect
Table Row (tr)
idname
Table Cell (td)

multiSelect

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get or set the multiSelect flag of the foundset.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// allow user to select multiple rows.
forms.customer.foundset.multiSelect = true;
Table Row (tr)
classlastDetailRow
Table Cell (td)
 



HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idaddFoundSetFilterParam-String_String_Object
Table Row (tr)
idname
Table Cell (td)

addFoundSetFilterParam

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
addFoundSetFilterParam
Span
(dataprovider, operator, value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Multiple filters can be added to the same dataprovider, they will all be applied.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} dataprovider - String column to filter on.
{String} operator - String operator: =, <, >, >=, <=, !=, (NOT) LIKE, (NOT) IN, (NOT) BETWEEN and IS (NOT) NULL optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null).
{Object} value - Object filter value (for in array and between an array with 2 elements)
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if adding the filter succeeded, false otherwise.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Filter a fondset on a dataprovider value.
// Note that multiple filters can be added to the same dataprovider, they will all be applied.

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)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idaddFoundSetFilterParam-String_String_Object_String
Table Row (tr)
idname
Table Cell (td)

addFoundSetFilterParam

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
addFoundSetFilterParam
Span
(dataprovider, operator, value, name)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
The filter is removed again using removeFoundSetFilterParam(name).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} dataprovider - String column to filter on.
{String} operator - String operator: =, <, >, >=, <=, !=, (NOT) LIKE, (NOT) IN, (NOT) BETWEEN and IS (NOT) NULL optionally augmented with modifiers "#" (ignore case) or "^||" (or-is-null).
{Object} value - Object filter value (for in array and between an array with 2 elements)
{String} name - String name, used to remove the filter again.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if adding the filter succeeded, false otherwise.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var success = forms.customer.foundset.addFoundSetFilterParam('customerid', '=', 'BLONP', 'custFilter');//possible to add multiple
// Named filters can be removed using forms.customer.foundset.removeFoundSetFilterParam(filterName)

// you can use modifiers in the operator as well, filter on companies where companyname is null or equals-ignore-case 'servoy'
var ok = forms.customer.foundset.addFoundSetFilterParam('companyname', '#^||=', 'servoy')

forms.customer.foundset.loadAllRecords();//to make param(s) effective
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idclear
Table Row (tr)
idname
Table Cell (td)

clear

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
clear
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Clear the foundset.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//Clear the foundset, including searches that may be on it
forms.customer.foundset.clear();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
iddeleteAllRecords
Table Row (tr)
idname
Table Cell (td)

deleteAllRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
deleteAllRecords
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Delete all records in foundset, resulting in empty foundset.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - boolean true if all records could be deleted.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var success = forms.customer.foundset.deleteAllRecords();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
iddeleteRecord
Table Row (tr)
idname
Table Cell (td)

deleteRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
deleteRecord
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Delete currently selected record(s).
If the foundset is in multiselect mode, all selected records are deleted.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - boolean true if all records could be deleted.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var success = forms.customer.foundset.deleteRecord();
//can return false incase of related foundset having records and orphans records are not allowed by the relation
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
iddeleteRecord-JSRecord
Table Row (tr)
idname
Table Cell (td)

deleteRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
deleteRecord
Span
(record)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Delete record from foundset.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{JSRecord} record - The record to delete from the foundset.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - boolean true if record could be deleted.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var success = forms.customer.foundset.deleteRecord(rec);
//can return false incase of related foundset having records and orphans records are not allowed by the relation
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
iddeleteRecord-Number
Table Row (tr)
idname
Table Cell (td)

deleteRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
deleteRecord
Span
(index)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Delete record with the given index.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} index - The index of the record to delete.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - boolean true if record could be deleted.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var success = forms.customer.foundset.deleteRecord(4);
//can return false incase of related foundset having records and orphans records are not allowed by the relation
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idduplicateFoundSet
Table Row (tr)
idname
Table Cell (td)

duplicateFoundSet

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSFoundSet
Span
stylefont-weight: bold;
duplicateFoundSet
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get a duplicate of the foundset.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
JSFoundSet - foundset duplicate.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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');
	forms.customer.foundset.loadRecords(dupFoundset);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idduplicateRecord
Table Row (tr)
idname
Table Cell (td)

duplicateRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
duplicateRecord
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Duplicate current record, change selection to new record, place on top.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - 0 if record was not created or the record index if it was created.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idduplicateRecord-Boolean
Table Row (tr)
idname
Table Cell (td)

duplicateRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
duplicateRecord
Span
(onTop)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Duplicate selected record, change selection to new record.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} onTop - when true the new record is added as the topmost record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - 0 if record was not created or the record index if it was created.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idduplicateRecord-Boolean_Boolean
Table Row (tr)
idname
Table Cell (td)

duplicateRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
duplicateRecord
Span
(onTop, changeSelection)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Duplicate selected record.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} onTop - when true the new record is added as the topmost record.
{Boolean} changeSelection - when true the selection is changed to the duplicated record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - 0 if record was not created or the record index if it was created.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idduplicateRecord-Number
Table Row (tr)
idname
Table Cell (td)

duplicateRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
duplicateRecord
Span
(index)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Duplicate record at index in the foundset, change selection to new record, place on top.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} index - The index of the record to duplicate; defaults to currently selected index. Ignored if first given parameter is a boolean value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - 0 if record was not created or the record index if it was created.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idduplicateRecord-Number_Boolean
Table Row (tr)
idname
Table Cell (td)

duplicateRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
duplicateRecord
Span
(index, onTop)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Duplicate record at index in the foundset, change selection to new record.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} index - The index of the record to duplicate; defaults to currently selected index. Ignored if first given parameter is a boolean value.
{Boolean} onTop - when true the new record is added as the topmost record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - 0 if record was not created or the record index if it was created.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idduplicateRecord-Number_Boolean_Boolean
Table Row (tr)
idname
Table Cell (td)

duplicateRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
duplicateRecord
Span
(index, onTop, changeSelection)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Duplicate record at index in the foundset.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} index - The index of the record to duplicate; defaults to currently selected index. Ignored if first given parameter is a boolean value.
{Boolean} onTop - when true the new record is added as the topmost record.
{Boolean} changeSelection - when true the selection is changed to the duplicated record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - 0 if record was not created or the record index if it was created.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idduplicateRecord-Number_Number
Table Row (tr)
idname
Table Cell (td)

duplicateRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
duplicateRecord
Span
(index, location)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Duplicate record at index in the foundset, change selection to new record.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} index - The index of the record to duplicate; defaults to currently selected index. Ignored if first given parameter is a boolean value.
{Number} location - the new record is added at specified index
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - 0 if record was not created or the record index if it was created.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idduplicateRecord-Number_Number_Boolean
Table Row (tr)
idname
Table Cell (td)

duplicateRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
duplicateRecord
Span
(index, location, changeSelection)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Duplicate record at index in the foundset.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} index - The index of the record to duplicate; defaults to currently selected index. Ignored if first given parameter is a boolean value.
{Number} location - the new record is added at specified index
{Boolean} changeSelection - when true the selection is changed to the duplicated record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - 0 if record was not created or the record index if it was created.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idfind
Table Row (tr)
idname
Table Cell (td)

find

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
find
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Set the foundset in find mode. (Start a find request), use the "search" function to perform/exit the find.

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.
Make sure the operator and the data (value) are part of the string passed to dataprovider (included inside a pair of quotation marks).
Note: always make sure to check the result of the find() method.

When in find mode, columns can be assigned string expressions (including operators) 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)
<x (less than value x)
>x (greater than value x)
<=x (less than or equals value x)
>=x (greater than or equals value x)
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 (equals value x, entire day)
now (equals now, date and or time)
// (equals today)
today (equals today)

Text fields:
#c (case insensitive condition)
= x (equals a space and 'x')
^= (is null or empty)
%x% (contains 'x')
%x_y% (contains 'x' followed by any char and 'y')
\% (contains char '%')
\_ (contains char '_')

Related columns can be assigned, they will result in related searches.
For example, "employees_to_department.location_id = headoffice" finds all employees in the specified location).

Searching on related aggregates is supported.
For example, "orders_to_details.total_amount = '>1000'" finds all orders with total order details amount more than 1000.

Arrays can be used for searching a number of values, this will result in an 'IN' condition that will be used in the search.
The values are not restricted to strings but can be any type that matches the column type.
For example, "record.department_id = [1, 33, 99]"

Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if the foundset is now in find mode, false otherwise.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
if (forms.customer.foundset.find()) //find will fail if autosave is disabled and there are unsaved records
{
	columnTextDataProvider = 'a search value'
	// for numbers you have to make sure to format it correctly so that the decimal point is in your locales notation (. or ,)
	columnNumberDataProvider = '>' + utils.numberFormat(anumber, '####.00');
	columnDateDataProvider = '31-12-2010|dd-MM-yyyy'
	forms.customer.foundset.search()
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetCurrentSort
Table Row (tr)
idname
Table Cell (td)

getCurrentSort

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getCurrentSort
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the current sort columns.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String - String sort columns
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//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)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetDataProviderValue-String
Table Row (tr)
idname
Table Cell (td)

getDataProviderValue

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object
Span
stylefont-weight: bold;
getDataProviderValue
Span
(dataProviderID)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get a value based on a dataprovider name.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} dataProviderID - data provider name
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Object - Object value
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var val = forms.customer.foundset.getDataProviderValue('contact_name');
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetDataSource
Table Row (tr)
idname
Table Cell (td)

getDataSource

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getDataSource
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the datasource used.
The datasource is an url that describes the data source.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String - String data source.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var dataSource = forms.customer.foundset.getDataSource();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetFoundSetFilterParams
Table Row (tr)
idname
Table Cell (td)

getFoundSetFilterParams

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object[][]
Span
stylefont-weight: bold;
getFoundSetFilterParams
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the list of previously defined foundset filters.
The result is an array of:
[ tableName, dataprovider, operator, value, name ]
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Object[][] - Array of filter definitions.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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]+']'))
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetFoundSetFilterParams-String
Table Row (tr)
idname
Table Cell (td)

getFoundSetFilterParams

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object[][]
Span
stylefont-weight: bold;
getFoundSetFilterParams
Span
(filterName)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get a previously defined foundset filter, using its given name.
The result is an array of:
[ tableName, dataprovider, operator, value, name ]
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} filterName - name of the filter to retrieve.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Object[][] - Array of filter definitions.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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]+']'))
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetQuery
Table Row (tr)
idname
Table Cell (td)

getQuery

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBSelect
Span
stylefont-weight: bold;
getQuery
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the query that the foundset is currently using.
When the founset is in find mode, the find conditions are included in the resulting query.
So the query that would be used when just calling search() (or search(true,true)) is returned.
Note that foundset filters are included and table filters are not included in the query.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBSelect - query.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var q = foundset.getQuery()
q.where.add(q.columns.x.eq(100))
foundset.loadRecords(q);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetRecord-Number
Table Row (tr)
idname
Table Cell (td)

getRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSRecord
Span
stylefont-weight: bold;
getRecord
Span
(index)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the record object at the index.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} index - record index
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
JSRecord - Record record.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var record = forms.customer.foundset.getRecord(index);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetRecordIndex-JSRecord
Table Row (tr)
idname
Table Cell (td)

getRecordIndex

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getRecordIndex
Span
(record)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the record index. Will return -1 if the record can't be found.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{JSRecord} record - Record
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - int index.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var index = forms.customer.foundset.getRecordIndex(record);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetRelationName
Table Row (tr)
idname
Table Cell (td)

getRelationName

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getRelationName
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the relation name (null if not a related foundset).
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String - String relation name when related.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var relName = forms.customer.foundset.getRelationName();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetSelectedIndex
Table Row (tr)
idname
Table Cell (td)

getSelectedIndex

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getSelectedIndex
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the current record index of the foundset.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - int current index (1-based)
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//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);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetSelectedIndexes
Table Row (tr)
idname
Table Cell (td)

getSelectedIndexes

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number[]
Span
stylefont-weight: bold;
getSelectedIndexes
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the indexes of the selected records.
When the founset is in multiSelect mode (see property multiSelect), a selection can consist of more than one index.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number[] - Array current indexes (1-based)
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// modify selection to the first selected item and the following row only
var current = forms.customer.foundset.getSelectedIndexes();
if (current.length > 1)
{
	var newSelection = new Array();
	newSelection[0] = current[0]; // first current selection
	newSelection[1] = current[0] + 1; // and the next row
	forms.customer.foundset.setSelectedIndexes(newSelection);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetSelectedRecord
Table Row (tr)
idname
Table Cell (td)

getSelectedRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSRecord
Span
stylefont-weight: bold;
getSelectedRecord
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the selected record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
JSRecord - Record record.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var selectedRecord = forms.customer.foundset.getSelectedRecord();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetSelectedRecords
Table Row (tr)
idname
Table Cell (td)

getSelectedRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSRecord[]
Span
stylefont-weight: bold;
getSelectedRecords
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the selected records.
When the founset is in multiSelect mode (see property multiSelect), selection can be a more than 1 record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
JSRecord[] - Array current records.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var selectedRecords = forms.customer.foundset.getSelectedRecords();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetSize
Table Row (tr)
idname
Table Cell (td)

getSize

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getSize
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - int current size.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idhasConditions
Table Row (tr)
idname
Table Cell (td)

hasConditions

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
hasConditions
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Check wether the foundset has any conditions from a previous find action.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - wether the foundset has find-conditions
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
if (forms.customer.foundset.hasConditions())
{
		// foundset had find actions
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idinvertRecords
Table Row (tr)
idname
Table Cell (td)

invertRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
invertRecords
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Invert the foundset against all rows of the current table.
All records that are not in the foundset will become the current foundset.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
forms.customer.foundset.invertRecords();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idisInFind
Table Row (tr)
idname
Table Cell (td)

isInFind

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
isInFind
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Check if this foundset is in find mode.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - boolean is in find mode.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//Returns true when find was called on this foundset and search has not been called yet
forms.customer.foundset.isInFind();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idloadAllRecords
Table Row (tr)
idname
Table Cell (td)

loadAllRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
loadAllRecords
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

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,

Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if records are loaded, false otherwise.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
forms.customer.foundset.loadAllRecords();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idloadOmittedRecords
Table Row (tr)
idname
Table Cell (td)

loadOmittedRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
loadOmittedRecords
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

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,

Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if records are loaded, false otherwise.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
forms.customer.foundset.loadOmittedRecords();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idloadRecords
Table Row (tr)
idname
Table Cell (td)

loadRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
loadRecords
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Reloads all last (related) records again, if, for example, after search in tabpanel.
When in find mode, this will reload the records from before the find() call.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if successful
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//to reload all last (related) records again, if for example when searched in tabpanel
 forms.customer.foundset.loadRecords();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idloadRecords-JSFoundSet
Table Row (tr)
idname
Table Cell (td)

loadRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
loadRecords
Span
(foundset)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Copies foundset data from another foundset.
This will alter the foundset state to the state of the foundset that is given.
If you really just want to use the given foundset on the form itself, then you need to use controller.loadRecords(foundset)
that will change the instance of the foundset that is used for this form. Not just update an existing form.

If you copy over a relation into this foundset, then this foundset will not be a related foundset, it will not automatically update its state
of records are updated or added that belong to that relation. It will only be a snapshot of that related foundsets state.

Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{JSFoundSet} foundset - The foundset to load records from
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if successful
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//Copies foundset data from another foundset
forms.customer.foundset.loadRecords(fs);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idloadRecords-JSDataSet
Table Row (tr)
idname
Table Cell (td)

loadRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
loadRecords
Span
(dataset)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Loads a primary key dataset, will remove related sort.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{JSDataSet} dataset - pkdataset
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if successful
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// loads 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);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idloadRecords-QBSelect
Table Row (tr)
idname
Table Cell (td)

loadRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
loadRecords
Span
(querybuilder)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Loads records into form foundset based on a query builder object (also known as 'Form by query').
When the founset is in find mode, the find states are discarded, the foundset will go out of find mode and the foundset will be loaded using the query.
If the foundset is related, the relation-condition will be added to the query.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{QBSelect} querybuilder - the query builder
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if successful
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
forms.customer.foundset.loadRecords(qbselect);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idloadRecords-UUID
Table Row (tr)
idname
Table Cell (td)

loadRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
loadRecords
Span
(uuidpk)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Loads a single record by primary key, will remove related sort.

NOTE: This function will return true if the foundset was altered/changed. It is up to the developer to check for the presence of actual data using getSize().

Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{UUID} uuidpk - single-column pk value
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if successful
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//Loads a single record by primary key, will remove related sort!
forms.customer.foundset.loadRecords(application.getUUID('6b5e2f5d-047e-45b3-80ee-3a32267b1f20'));
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idloadRecords-Number
Table Row (tr)
idname
Table Cell (td)

loadRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
loadRecords
Span
(numberpk)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Loads a single record by primary key, will remove related sort.

NOTE: This function will return true if the foundset was altered/changed. It is up to the developer to check for the presence of actual data using getSize().

Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} numberpk - single-column pk value
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if successful
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//Loads a single record by primary key, will remove related sort!
forms.customer.foundset.loadRecords(123);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idloadRecords-String
Table Row (tr)
idname
Table Cell (td)

loadRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
loadRecords
Span
(queryString)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Loads records into form foundset based on a query (also known as 'Form by query'). The query must be a valid sql select.
If the foundset is related this function is not allowed.

see foundset.loadRecords(QBSelect).

Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} queryString - select statement
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if successful
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//loads records in to the foundset based on a query (also known as 'Form by query')
forms.customer.foundset.loadRecords(sqlstring);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idloadRecords-String_ObjectArray
Table Row (tr)
idname
Table Cell (td)

loadRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
loadRecords
Span
(queryString, argumentsArray)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Loads records into form foundset based on a query (also known as 'Form by query'). The query must be a valid sql select.
If the foundset is related this function is not allowed.

see foundset.loadRecords(QBSelect).

Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} queryString - select statement
{Object[]} argumentsArray - arguments to query
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if successful
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//loads records in to the foundset based on a query (also known as 'Form by query')
forms.customer.foundset.loadRecords(sqlstring,parameters);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idnewRecord
Table Row (tr)
idname
Table Cell (td)

newRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
newRecord
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create a new record on top of the foundset and change selection to it. Returns -1 if the record can't be made.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - int index of new record.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// foreign key data is only filled in for equals (=) relation items
var idx = forms.customer.foundset.newRecord(false); // add as last record
// forms.customer.foundset.newRecord(); // adds as first record
// forms.customer.foundset.newRecord(2); //adds as second record
if (idx >= 0) // returned index is -1 in case of failure
{
	forms.customer.foundset.some_column = "some text";
	application.output("added on position " + idx);
	// when adding at the end of the foundset, the returned index
	// corresponds with the size of the foundset
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idnewRecord-Boolean
Table Row (tr)
idname
Table Cell (td)

newRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
newRecord
Span
(onTop)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create a new record in the foundset and change selection to it. Returns -1 if the record can't be made.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} onTop - when true the new record is added as the topmost record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - int index of new record.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// foreign key data is only filled in for equals (=) relation items
var idx = forms.customer.foundset.newRecord(false); // add as last record
// forms.customer.foundset.newRecord(); // adds as first record
// forms.customer.foundset.newRecord(2); //adds as second record
if (idx >= 0) // returned index is -1 in case of failure
{
	forms.customer.foundset.some_column = "some text";
	application.output("added on position " + idx);
	// when adding at the end of the foundset, the returned index
	// corresponds with the size of the foundset
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idnewRecord-Boolean_Boolean
Table Row (tr)
idname
Table Cell (td)

newRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
newRecord
Span
(onTop, changeSelection)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create a new record in the foundset. Returns -1 if the record can't be made.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} onTop - when true the new record is added as the topmost record.
{Boolean} changeSelection - when true the selection is changed to the new record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - int index of new record.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// foreign key data is only filled in for equals (=) relation items
var idx = forms.customer.foundset.newRecord(false); // add as last record
// forms.customer.foundset.newRecord(); // adds as first record
// forms.customer.foundset.newRecord(2); //adds as second record
if (idx >= 0) // returned index is -1 in case of failure
{
	forms.customer.foundset.some_column = "some text";
	application.output("added on position " + idx);
	// when adding at the end of the foundset, the returned index
	// corresponds with the size of the foundset
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idnewRecord-Number
Table Row (tr)
idname
Table Cell (td)

newRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
newRecord
Span
(index)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create a new record in the foundset and change selection to it. Returns -1 if the record can't be made.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} index - the new record is added at specified index.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - int index of new record.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// foreign key data is only filled in for equals (=) relation items
var idx = forms.customer.foundset.newRecord(false); // add as last record
// forms.customer.foundset.newRecord(); // adds as first record
// forms.customer.foundset.newRecord(2); //adds as second record
if (idx >= 0) // returned index is -1 in case of failure
{
	forms.customer.foundset.some_column = "some text";
	application.output("added on position " + idx);
	// when adding at the end of the foundset, the returned index
	// corresponds with the size of the foundset
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idnewRecord-Number_Boolean
Table Row (tr)
idname
Table Cell (td)

newRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
newRecord
Span
(index, changeSelection)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create a new record in the foundset. Returns -1 if the record can't be made.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} index - the new record is added at specified index.
{Boolean} changeSelection - when true the selection is changed to the new record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - int index of new record.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// foreign key data is only filled in for equals (=) relation items
var idx = forms.customer.foundset.newRecord(false); // add as last record
// forms.customer.foundset.newRecord(); // adds as first record
// forms.customer.foundset.newRecord(2); //adds as second record
if (idx >= 0) // returned index is -1 in case of failure
{
	forms.customer.foundset.some_column = "some text";
	application.output("added on position " + idx);
	// when adding at the end of the foundset, the returned index
	// corresponds with the size of the foundset
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idomitRecord
Table Row (tr)
idname
Table Cell (td)

omitRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
omitRecord
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Omit current record, 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()

Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - boolean true if all records could be omitted.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var success = forms.customer.foundset.omitRecord();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idomitRecord-Number
Table Row (tr)
idname
Table Cell (td)

omitRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
omitRecord
Span
(index)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

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

Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} index - The index of the record to omit.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - boolean true if all records could be omitted.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var success = forms.customer.foundset.omitRecord();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idrelookup
Table Row (tr)
idname
Table Cell (td)

relookup

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
relookup
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Perform a relookup for the currently selected records
Lookups are defined in the dataprovider (columns) auto-enter setting and are normally performed over a relation upon record creation.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
forms.customer.foundset.relookup(1);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idrelookup-Number
Table Row (tr)
idname
Table Cell (td)

relookup

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
relookup
Span
(index)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Perform a relookup for 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.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} index - record index (1-based)
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
forms.customer.foundset.relookup(1);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idremoveFoundSetFilterParam-String
Table Row (tr)
idname
Table Cell (td)

removeFoundSetFilterParam

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
removeFoundSetFilterParam
Span
(name)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Remove a named foundset filter.
Use clear() or loadAllRecords() to make the filter effective.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} name - String filter name.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if removing the filter succeeded, false otherwise.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var success = forms.customer.foundset.removeFoundSetFilterParam('custFilter');// removes all filters with this name
forms.customer.foundset.loadAllRecords();//to make param(s) effective
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsearch
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
search
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Start the database search and use the results, returns the number of records, make sure you did "find" function first.
Clear results from previous searches.

Note: Omitted records are automatically excluded when performing a search - meaning that the foundset result by default will not include omitted records.

Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - the recordCount
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var recordCount = forms.customer.foundset.search();
//var recordCount = forms.customer.foundset.search(false,false); //to extend foundset
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsearch-Boolean
Table Row (tr)
idname
Table Cell (td)

search

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
search
Span
(clearLastResults)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Start the database search and use the results, returns the number of records, make sure you did "find" function first.
Reduce results from previous searches.

Note: Omitted records are automatically excluded when performing a search - meaning that the foundset result by default will not include omitted records.

Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} clearLastResults - boolean, clear previous search, default true
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - the recordCount
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var recordCount = forms.customer.foundset.search();
//var recordCount = forms.customer.foundset.search(false,false); //to extend foundset
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsearch-Boolean_Boolean
Table Row (tr)
idname
Table Cell (td)

search

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
search
Span
(clearLastResults, reduceSearch)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Start the database search and use the results, returns the number of records, make sure you did "find" function first.

Note: Omitted records are automatically excluded when performing a search - meaning that the foundset result by default will not include omitted records.

Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} clearLastResults - boolean, clear previous search, default true
{Boolean} reduceSearch - boolean, reduce (true) or extend (false) previous search results, default true
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number - the recordCount
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var recordCount = forms.customer.foundset.search();
//var recordCount = forms.customer.foundset.search(false,false); //to extend foundset
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idselectRecord-__
Table Row (tr)
idname
Table Cell (td)

selectRecord

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
selectRecord
Span
(pkid1, [pkid2], [pkidn])
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

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.

Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
pkid1 - primary key
[pkid2] - second primary key (in case of composite primary key)
[pkidn] - nth primary key
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if succeeded.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
forms.customer.foundset.selectRecord(pkid1,pkid2,pkidn);//pks must be alphabetically set! It is also possible to use an array as parameter.
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsetDataProviderValue-String_Object
Table Row (tr)
idname
Table Cell (td)

setDataProviderValue

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setDataProviderValue
Span
(dataProviderID, value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set a value based on a dataprovider name.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} dataProviderID - data provider name
{Object} value - value to set
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
forms.customer.foundset.setDataProviderValue('contact_name','mycompany');
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsetSelectedIndex-Number
Table Row (tr)
idname
Table Cell (td)

setSelectedIndex

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setSelectedIndex
Span
(index)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the current record index.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} index - index to set (1-based)
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//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);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsetSelectedIndexes-NumberArray
Table Row (tr)
idname
Table Cell (td)

setSelectedIndexes

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setSelectedIndexes
Span
(indexes)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the selected records indexes.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number[]} indexes - An array with indexes to set.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// modify selection to the first selected item and the following row only
var current = forms.customer.foundset.getSelectedIndexes();
if (current.length > 1)
{
	var newSelection = new Array();
	newSelection[0] = current[0]; // first current selection
	newSelection[1] = current[0] + 1; // and the next row
	forms.customer.foundset.setSelectedIndexes(newSelection);
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsort-String
Table Row (tr)
idname
Table Cell (td)

sort

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
sort
Span
(sortString)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} sortString - the specified columns (and sort order)
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
forms.customer.foundset.sort('columnA desc,columnB asc');
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsort-String_Boolean
Table Row (tr)
idname
Table Cell (td)

sort

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
sort
Span
(sortString, defer)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} sortString - the specified columns (and sort order)
{Boolean} defer - 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).
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
forms.customer.foundset.sort('columnA desc,columnB asc');
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsort-Function
Table Row (tr)
idname
Table Cell (td)

sort

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
sort
Span
(recordComparisonFunction)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Sorts the foundset based on the given record comparator function.
The comparator function is called to compare
two records, that are passed as arguments, and
it will return -1/0/1 if the first record is less/equal/greater
then the second record.

The function based sorting does not work with printing.
It is just a temporary in-memory sort.

NOTE: starting with 7.2 release this function doesn't save the data anymore

Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Function} recordComparisonFunction - record comparator function
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
forms.customer.foundset.sort(mySortFunction);

function mySortFunction(r1, r2)
{
	var o = 0;
	if(r1.id < r2.id)
	{
		o = -1;
	}
	else if(r1.id > r2.id)
	{
		o = 1;
	}
	return o;
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idunrelate
Table Row (tr)
idname
Table Cell (td)

unrelate

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSFoundSet
Span
stylefont-weight: bold;
unrelate
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create a new unrelated foundset that is a copy of the current foundset.
If the current foundset is not related, no copy will made.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
JSFoundSet - FoundSet unrelated foundset.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
forms.customer.foundset.unrelate();
Table Row (tr)
classlastDetailRow
Table Cell (td)