Apr 19, 2024 22:41 Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients SampleSupported Clients
SmartClient
WebClient
NGClient
MobileClient
Property Summary
Array
alldataproviders
Get all dataproviders of the foundset.
Boolean
multiSelect
Get or set the multiSelect flag of the foundset.
Methods Summary
Boolean
addFoundSetFilterParam(dataprovider, operator, value)
Add a filter parameter that is permanent per user session to limit a specified foundset of records.
Boolean
addFoundSetFilterParam(dataprovider, operator, value, name)
Add a filter parameter that is permanent per user session to limit a specified foundset of records.
void
clear()
Clear the foundset.
Boolean
deleteAllRecords()
Delete all records in foundset, resulting in empty foundset.
Boolean
deleteRecord()
Delete currently selected record(s).
Boolean
deleteRecord(record)
Delete record from foundset.
Boolean
deleteRecord(index)
Delete record with the given index.
JSFoundSet
duplicateFoundSet()
Get a duplicate of the foundset.
Number
duplicateRecord()
Duplicate current record, change selection to new record, place on top.
Number
duplicateRecord(onTop)
Duplicate selected record, change selection to new record.
Number
duplicateRecord(onTop, changeSelection)
Duplicate selected record.
Number
duplicateRecord(index)
Duplicate record at index in the foundset, change selection to new record, place on top.
Number
duplicateRecord(index, onTop)
Duplicate record at index in the foundset, change selection to new record.
Number
duplicateRecord(index, onTop, changeSelection)
Duplicate record at index in the foundset.
Number
duplicateRecord(index, location)
Duplicate record at index in the foundset, change selection to new record.
Number
duplicateRecord(index, location, changeSelection)
Duplicate record at index in the foundset.
Boolean
find()
Set the foundset in find mode.
Object
forEach(callback)
Iterates over the records of a foundset taking into account inserts and deletes that may happen at the same time.
String
getCurrentSort()
Get the current sort columns.
Object
getDataProviderValue(dataProviderID)
Get a value based on a dataprovider name.
String
getDataSource()
Get the datasource used.
Array
getFoundSetFilterParams()
Get the list of previously defined foundset filters.
Array
getFoundSetFilterParams(filterName)
Get a previously defined foundset filter, using its given name.
QBSelect
getQuery()
Get the query that the foundset is currently using.
JSRecord
getRecord(index)
Get the record object at the index.
Number
getRecordIndex(record)
Get the record index.
String
getRelationName()
Gets the relation name (null if not a related foundset).
Number
getSelectedIndex()
Get the current record index of the foundset.
Array
getSelectedIndexes()
Get the indexes of the selected records.
JSRecord
getSelectedRecord()
Get the selected record.
Array
getSelectedRecords()
Get the selected records.
Number
getSize()
Get the number of records in this foundset.
Boolean
hasConditions()
Check wether the foundset has any conditions from a previous find action.
void
invertRecords()
Invert the foundset against all rows of the current table.
Boolean
isInFind()
Check if this foundset is in find mode.
Boolean
loadAllRecords()
Loads all accessible records from the datasource into the foundset.
Boolean
loadOmittedRecords()
Loads the records that are currently omitted as a foundset.
Boolean
loadRecords()
Reloads all last (related) records again, if, for example, after search in tabpanel.
Boolean
loadRecords(foundset)
Copies foundset data from another foundset.
Boolean
loadRecords(dataset)
Loads a primary key dataset, will remove related sort.
Boolean
loadRecords(querybuilder)
Loads records into form foundset based on a query builder object (also known as 'Form by query').
Boolean
loadRecords(uuidpk)
Loads a single record by primary key, will remove related sort.
Boolean
loadRecords(numberpk)
Loads a single record by primary key, will remove related sort.
Boolean
loadRecords(queryString)
Loads records into form foundset based on a query (also known as 'Form by query').
Boolean
loadRecords(queryString, argumentsArray)
Loads records into form foundset based on a query (also known as 'Form by query').
Number
newRecord()
Create a new record on top of the foundset and change selection to it.
Number
newRecord(onTop)
Create a new record in the foundset and change selection to it.
Number
newRecord(onTop, changeSelection)
Create a new record in the foundset.
Number
newRecord(index)
Create a new record in the foundset and change selection to it.
Number
newRecord(index, changeSelection)
Create a new record in the foundset.
Boolean
omitRecord()
Omit current record, to be shown with loadOmittedRecords.
Boolean
omitRecord(index)
Omit record under the given index, to be shown with loadOmittedRecords.
void
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.
void
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.
Boolean
removeFoundSetFilterParam(name)
Remove a named foundset filter.
Number
search()
Start the database search and use the results, returns the number of records, make sure you did "find" function first.
Number
search(clearLastResults)
Start the database search and use the results, returns the number of records, make sure you did "find" function first.
Number
search(clearLastResults, reduceSearch)
Start the database search and use the results, returns the number of records, make sure you did "find" function first.
Boolean
selectRecord(pkid1, pkid2, pkidn)
Select the record based on pk data.
void
setDataProviderValue(dataProviderID, value)
Set a value based on a dataprovider name.
void
setSelectedIndex(index)
Set the current record index.
void
setSelectedIndexes(indexes)
Set the selected records indexes.
void
sort(sortString)
Sorts the foundset based on the given sort string.
void
sort(sortString, defer)
Sorts the foundset based on the given sort string.
void
sort(recordComparisonFunction)
Sorts the foundset based on the given record comparator function.
JSFoundSet
unrelate()
Create a new unrelated foundset that is a copy of the current foundset.
Property Details
alldataproviders
var dataprovidersNames = %%prefix%%alldataproviders;
application.output("This foundset has " + dataprovidersNames.length + " data providers.")
for (var i=0; i<dataprovidersNames.length; i++)
application.output(dataprovidersNames[i]);
multiSelect
// allow user to select multiple rows.
%%prefix%%foundset.multiSelect = true;
Methods Details
addFoundSetFilterParam(dataprovider, operator, value)
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)
var success = %%prefix%%foundset.addFoundSetFilterParam('customerid', '=', 'BLONP', 'custFilter');//possible to add multiple
// Named filters can be removed using %%prefix%%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 = %%prefix%%foundset.addFoundSetFilterParam('companyname', '#^||=', 'servoy')
// Filters with in-conditions can be used with arrays or with custom queries:
success = foundset.addFoundSetFilterParam("productcode", "in", [120, 144, 200]);
success = foundset.addFoundSetFilterParam("city", "in", ["London", "Paris"]);
success = foundset.addFoundSetFilterParam("countrycode", "in", "select country code from countries where region in ('Europe', 'Asia')");
%%prefix%%foundset.loadAllRecords();//to make param(s) effective
addFoundSetFilterParam(dataprovider, operator, value, name)
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.
var success = %%prefix%%foundset.addFoundSetFilterParam('customerid', '=', 'BLONP', 'custFilter');//possible to add multiple
// Named filters can be removed using %%prefix%%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 = %%prefix%%foundset.addFoundSetFilterParam('companyname', '#^||=', 'servoy')
// Filters with in-conditions can be used with arrays or with custom queries:
success = foundset.addFoundSetFilterParam("productcode", "in", [120, 144, 200]);
success = foundset.addFoundSetFilterParam("city", "in", ["London", "Paris"]);
success = foundset.addFoundSetFilterParam("countrycode", "in", "select country code from countries where region in ('Europe', 'Asia')");
%%prefix%%foundset.loadAllRecords();//to make param(s) effective
clear()
//Clear the foundset, including searches that may be on it
%%prefix%%foundset.clear();
deleteAllRecords()
var success = %%prefix%%foundset.deleteAllRecords();
deleteRecord()
var success = %%prefix%%foundset.deleteRecord();
//can return false incase of related foundset having records and orphans records are not allowed by the relation
deleteRecord(record)
JSRecord
record
The record to delete from the foundset.
var success = %%prefix%%foundset.deleteRecord(rec);
//can return false incase of related foundset having records and orphans records are not allowed by the relation
deleteRecord(index)
Number
index
The index of the record to delete.
var success = %%prefix%%foundset.deleteRecord(4);
//can return false incase of related foundset having records and orphans records are not allowed by the relation
duplicateFoundSet()
var dupFoundset = %%prefix%%foundset.duplicateFoundSet();
%%prefix%%foundset.find();
//search some fields
var count = %%prefix%%foundset.search();
if (count == 0)
{
plugins.dialogs.showWarningDialog('Alert', 'No records found','OK');
%%prefix%%foundset.loadRecords(dupFoundset);
}
duplicateRecord()
%%prefix%%foundset.duplicateRecord();
%%prefix%%foundset.duplicateRecord(false); //duplicate the current record, adds at bottom
%%prefix%%foundset.duplicateRecord(1,2); //duplicate the first record as second record
//duplicates the record (record index 3), adds on top and selects the record
%%prefix%%foundset.duplicateRecord(3,true,true);
duplicateRecord(onTop)
Boolean
onTop
when true the new record is added as the topmost record.
%%prefix%%foundset.duplicateRecord();
%%prefix%%foundset.duplicateRecord(false); //duplicate the current record, adds at bottom
%%prefix%%foundset.duplicateRecord(1,2); //duplicate the first record as second record
//duplicates the record (record index 3), adds on top and selects the record
%%prefix%%foundset.duplicateRecord(3,true,true);
duplicateRecord(onTop, changeSelection)
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.
%%prefix%%foundset.duplicateRecord();
%%prefix%%foundset.duplicateRecord(false); //duplicate the current record, adds at bottom
%%prefix%%foundset.duplicateRecord(1,2); //duplicate the first record as second record
//duplicates the record (record index 3), adds on top and selects the record
%%prefix%%foundset.duplicateRecord(3,true,true);
duplicateRecord(index)
Number
index
The index of the record to duplicate; defaults to currently selected index. Ignored if first given parameter is a boolean value.
%%prefix%%foundset.duplicateRecord();
%%prefix%%foundset.duplicateRecord(false); //duplicate the current record, adds at bottom
%%prefix%%foundset.duplicateRecord(1,2); //duplicate the first record as second record
//duplicates the record (record index 3), adds on top and selects the record
%%prefix%%foundset.duplicateRecord(3,true,true);
duplicateRecord(index, onTop)
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.
%%prefix%%foundset.duplicateRecord();
%%prefix%%foundset.duplicateRecord(false); //duplicate the current record, adds at bottom
%%prefix%%foundset.duplicateRecord(1,2); //duplicate the first record as second record
//duplicates the record (record index 3), adds on top and selects the record
%%prefix%%foundset.duplicateRecord(3,true,true);
duplicateRecord(index, onTop, changeSelection)
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.
%%prefix%%foundset.duplicateRecord();
%%prefix%%foundset.duplicateRecord(false); //duplicate the current record, adds at bottom
%%prefix%%foundset.duplicateRecord(1,2); //duplicate the first record as second record
//duplicates the record (record index 3), adds on top and selects the record
%%prefix%%foundset.duplicateRecord(3,true,true);
duplicateRecord(index, location)
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
%%prefix%%foundset.duplicateRecord();
%%prefix%%foundset.duplicateRecord(false); //duplicate the current record, adds at bottom
%%prefix%%foundset.duplicateRecord(1,2); //duplicate the first record as second record
//duplicates the record (record index 3), adds on top and selects the record
%%prefix%%foundset.duplicateRecord(3,true,true);
duplicateRecord(index, location, changeSelection)
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.
%%prefix%%foundset.duplicateRecord();
%%prefix%%foundset.duplicateRecord(false); //duplicate the current record, adds at bottom
%%prefix%%foundset.duplicateRecord(1,2); //duplicate the first record as second record
//duplicates the record (record index 3), adds on top and selects the record
%%prefix%%foundset.duplicateRecord(3,true,true);
find()
if (%%prefix%%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'
%%prefix%%foundset.search()
}
forEach(callback)
Function
callback
The callback function to be called for each loaded record in the foundset. Can receive three parameters: the record to be processed, the index of the record in the foundset, and the foundset that is traversed.
foundset.forEach(function(record,recordIndex,foundset) {
//handle the record here
});
getCurrentSort()
//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)
getDataProviderValue(dataProviderID)
String
dataProviderID
data provider name
var val = %%prefix%%foundset.getDataProviderValue('contact_name');
getDataSource()
var dataSource = %%prefix%%foundset.getDataSource();
getFoundSetFilterParams()
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]+']'))
}
getFoundSetFilterParams(filterName)
String
filterName
name of the filter to retrieve.
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]+']'))
}
getQuery()
var q = foundset.getQuery()
q.where.add(q.columns.x.eq(100))
foundset.loadRecords(q);
getRecord(index)
Number
index
record index
var record = %%prefix%%foundset.getRecord(index);
getRecordIndex(record)
JSRecord
record
Record
var index = %%prefix%%foundset.getRecordIndex(record);
getRelationName()
var relName = %%prefix%%foundset.getRelationName();
getSelectedIndex()
//gets the current record index in the current foundset
var current = %%prefix%%foundset.getSelectedIndex();
//sets the next record in the foundset
%%prefix%%foundset.setSelectedIndex(current+1);
getSelectedIndexes()
// modify selection to the first selected item and the following row only
var current = %%prefix%%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
%%prefix%%foundset.setSelectedIndexes(newSelection);
}
getSelectedRecord()
var selectedRecord = %%prefix%%foundset.getSelectedRecord();
getSelectedRecords()
var selectedRecords = %%prefix%%foundset.getSelectedRecords();
getSize()
var nrRecords = %%prefix%%foundset.getSize()
// to loop over foundset, recalculate size for each record
for (var i = 1; i <= %%prefix%%foundset.getSize(); i++)
{
var rec = %%prefix%%foundset.getRecord(i);
}
hasConditions()
if (%%prefix%%foundset.hasConditions())
{
// foundset had find actions
}
invertRecords()
%%prefix%%foundset.invertRecords();
isInFind()
//Returns true when find was called on this foundset and search has not been called yet
%%prefix%%foundset.isInFind();
loadAllRecords()
%%prefix%%foundset.loadAllRecords();
loadOmittedRecords()
%%prefix%%foundset.loadOmittedRecords();
loadRecords()
//to reload all last (related) records again, if for example when searched in tabpanel
%%prefix%%foundset.loadRecords();
loadRecords(foundset)
JSFoundSet
foundset
The foundset to load records from
//Copies foundset data from another foundset
%%prefix%%foundset.loadRecords(fs);
loadRecords(dataset)
JSDataSet
dataset
pkdataset
// loads a primary key dataset, will remove related sort!
//var dataset = databaseManager.getDataSetByQuery(...);
// dataset must match the table primary key columns (alphabetically ordered)
%%prefix%%foundset.loadRecords(dataset);
loadRecords(querybuilder)
QBSelect
querybuilder
the query builder
%%prefix%%foundset.loadRecords(qbselect);
loadRecords(uuidpk)
UUID
uuidpk
single-column pk value
//Loads a single record by primary key, will remove related sort!
%%prefix%%foundset.loadRecords(application.getUUID('6b5e2f5d-047e-45b3-80ee-3a32267b1f20'));
loadRecords(numberpk)
Number
numberpk
single-column pk value
//Loads a single record by primary key, will remove related sort!
%%prefix%%foundset.loadRecords(123);
loadRecords(queryString)
String
queryString
select statement
//loads records in to the foundset based on a query (also known as 'Form by query')
%%prefix%%foundset.loadRecords(sqlstring);
loadRecords(queryString, argumentsArray)
String
queryString
select statement
Array
argumentsArray
arguments to query
//loads records in to the foundset based on a query (also known as 'Form by query')
%%prefix%%foundset.loadRecords(sqlstring,parameters);
newRecord()
// foreign key data is only filled in for equals (=) relation items
var idx = %%prefix%%foundset.newRecord(false); // add as last record
// %%prefix%%foundset.newRecord(); // adds as first record
// %%prefix%%foundset.newRecord(2); //adds as second record
if (idx >= 0) // returned index is -1 in case of failure
{
%%prefix%%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
}
newRecord(onTop)
Boolean
onTop
when true the new record is added as the topmost record.
// foreign key data is only filled in for equals (=) relation items
var idx = %%prefix%%foundset.newRecord(false); // add as last record
// %%prefix%%foundset.newRecord(); // adds as first record
// %%prefix%%foundset.newRecord(2); //adds as second record
if (idx >= 0) // returned index is -1 in case of failure
{
%%prefix%%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
}
newRecord(onTop, changeSelection)
Boolean
onTop
when true the new record is added as the topmost record; when false
the record is added to the end, if all records are loaded, otherwise it will be added to the top
Boolean
changeSelection
when true the selection is changed to the new record.
// foreign key data is only filled in for equals (=) relation items
var idx = %%prefix%%foundset.newRecord(false); // add as last record
// %%prefix%%foundset.newRecord(); // adds as first record
// %%prefix%%foundset.newRecord(2); //adds as second record
if (idx >= 0) // returned index is -1 in case of failure
{
%%prefix%%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
}
newRecord(index)
Number
index
the new record is added at specified index.
// foreign key data is only filled in for equals (=) relation items
var idx = %%prefix%%foundset.newRecord(false); // add as last record
// %%prefix%%foundset.newRecord(); // adds as first record
// %%prefix%%foundset.newRecord(2); //adds as second record
if (idx >= 0) // returned index is -1 in case of failure
{
%%prefix%%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
}
newRecord(index, changeSelection)
Number
index
the new record is added at specified index.
Boolean
changeSelection
when true the selection is changed to the new record.
// foreign key data is only filled in for equals (=) relation items
var idx = %%prefix%%foundset.newRecord(false); // add as last record
// %%prefix%%foundset.newRecord(); // adds as first record
// %%prefix%%foundset.newRecord(2); //adds as second record
if (idx >= 0) // returned index is -1 in case of failure
{
%%prefix%%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
}
omitRecord()
var success = %%prefix%%foundset.omitRecord();
omitRecord(index)
Number
index
The index of the record to omit.
var success = %%prefix%%foundset.omitRecord();
relookup()
%%prefix%%foundset.relookup(1);
relookup(index)
Number
index
record index (1-based)
%%prefix%%foundset.relookup(1);
removeFoundSetFilterParam(name)
String
name
String filter name.
var success = %%prefix%%foundset.removeFoundSetFilterParam('custFilter');// removes all filters with this name
%%prefix%%foundset.loadAllRecords();//to make param(s) effective
search()
var recordCount = %%prefix%%foundset.search();
//var recordCount = %%prefix%%foundset.search(false,false); //to extend foundset
search(clearLastResults)
Boolean
clearLastResults
boolean, clear previous search, default true
var recordCount = %%prefix%%foundset.search();
//var recordCount = %%prefix%%foundset.search(false,false); //to extend foundset
search(clearLastResults, reduceSearch)
Boolean
clearLastResults
boolean, clear previous search, default true
Boolean
reduceSearch
boolean, reduce (true) or extend (false) previous search results, default true
var recordCount = %%prefix%%foundset.search();
//var recordCount = %%prefix%%foundset.search(false,false); //to extend foundset
selectRecord(pkid1, pkid2, pkidn)
pkid1
primary key
pkid2
second primary key (in case of composite primary key)
pkidn
nth primary key
%%prefix%%foundset.selectRecord(pkid1,pkid2,pkidn);//pks must be alphabetically set! It is also possible to use an array as parameter.
setDataProviderValue(dataProviderID, value)
String
dataProviderID
data provider name
Object
value
value to set
%%prefix%%foundset.setDataProviderValue('contact_name','mycompany');
setSelectedIndex(index)
Number
index
index to set (1-based)
//gets the current record index in the current foundset
var current = %%prefix%%foundset.getSelectedIndex();
//sets the next record in the foundset
%%prefix%%foundset.setSelectedIndex(current+1);
setSelectedIndexes(indexes)
Array
indexes
An array with indexes to set.
// modify selection to the first selected item and the following row only
var current = %%prefix%%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
%%prefix%%foundset.setSelectedIndexes(newSelection);
}
sort(sortString)
String
sortString
the specified columns (and sort order)
%%prefix%%foundset.sort('columnA desc,columnB asc');
sort(sortString, defer)
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).
%%prefix%%foundset.sort('columnA desc,columnB asc');
sort(recordComparisonFunction)
Function
recordComparisonFunction
record comparator function
%%prefix%%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;
}
unrelate()
%%prefix%%foundset.unrelate();