Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
Table Body (tbody) |
---|
id | addFoundSetFilterParam |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
addFoundSetFilterParam |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| addFoundSetFilterParam |
Span |
---|
| (dataprovider, operator, value, [name]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Add a filter parameter that is permanent per user session to limit a specified foundset of records. Use clear() or loadAllRecords() to make the filter effective. When given a name, the filter can be removed again using removeFoundSetFilterParam(name). |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} dataprovider – String column to filter on. {String} operator – String operator: =, <, >, >=, <=, !=, LIKE, or IN. {Object} value – Object filter value. {String} [name] – String name, can be used to remove the filter again. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Boolean – true if adding the filter succeeded, false otherwise. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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 Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| clear |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Clear the foundset. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//Clear the foundset, including searches that may be on it
forms.customer.foundset.clear();
|
|
|
|
|
Table Body (tbody) |
---|
id | deleteAllRecords |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
deleteAllRecords |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| deleteAllRecords |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Delete all records in foundset, resulting in empty foundset. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Boolean – boolean true if all records could be deleted. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var success = forms.customer.foundset.deleteAllRecords();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
deleteRecord |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| deleteRecord |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Delete current/parameter record or the record under the given index. If the foundset is in multiselect mode, all selected records are deleted (when no index parameter is used). |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters [index/record] – index of record to delete or record itself. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Boolean – boolean true if all records could be deleted. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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 Body (tbody) |
---|
id | duplicateFoundSet |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
duplicateFoundSet |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| JSFoundset |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| duplicateFoundSet |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get a duplicate of the foundset. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns JSFoundset – foundset duplicate. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var dupFoundset = forms.customer.foundset.duplicateFoundSet();
forms.customer.foundset.find();
//search some fields
var count = forms.customer.foundset.search();
if (count == 0)
{
plugins.dialogs.showWarningDialog('Alert', 'No records found','OK');
controller.loadRecords(dupFoundset);
}
|
|
|
|
|
Table Body (tbody) |
---|
id | duplicateRecord |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
duplicateRecord |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| duplicateRecord |
Span |
---|
| ([index], [location], [changeSelection]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Duplicate current record or record at index in the foundset. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters [index] – index of record to duplicate; defaults to currently selected index. Ignored if first given parameter is a boolean value. [location] – boolean or number when true the new record is added as the topmost record, when a number, the new record is added at specified index ; defaults to 0. [changeSelection] – boolean when true the selection is changed to the duplicated record; defaults to true. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Number – true if succesful |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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 Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| find |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Set the foundset in find mode. Before going into find mode, all unsaved records will be saved in the database. If this fails (due to validation failures or sql errors) or is not allowed (autosave off), the foundset will not go into find mode. Note: always make sure to check the result of the find() method. When in find mode, columns can be assigned string expressions that are evaluated as: General: c1||c2 (condition1 or condition2) c|format (apply format on condition like 'x|dd-MM-yyyy') !c (not condition) #c (modify condition, depends on column type) ^ (is null) ^= (is null or empty/zero) <x >x <=x >=x (comparison) x...y (between values x and y, including values) x (equals value x) Number fields: =x (equals value x) ^= (is null or zero) Date fields #c (modify condition, match on entire day) now (equals now, date and or time) // (equals today) today (equals today) Text fields: #c (modify condition, case insensitive search) ^= (is null or empty) %x% (contains x) %x_y% (contains x followed by any char and y) % (contains char '%') _ (contains char '_') 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. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Boolean – true if the foundset is now in find mode, false otherwise. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
if (forms.customer.foundset.find()) //find will fail if autosave is disabled and there are unsaved records
{
columnTextDataProvider = 'a search value'
columnNumberDataProvider = '>10'
forms.customer.foundset.search()
}
|
|
|
|
|
Table Body (tbody) |
---|
id | getCurrentSort |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getCurrentSort |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getCurrentSort |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get the current sort columns. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String – String sort columns |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//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 Body (tbody) |
---|
id | getDataProviderValue |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getDataProviderValue |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Object |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getDataProviderValue |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get a value based on a dataprovider name. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} dataProviderID – data provider name |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Object – Object value |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var val = forms.customer.foundset.getDataProviderValue('contact_name');
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getDataSource |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getDataSource |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get the datasource used. The datasource is an url that describes the data source. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String – String data source. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var dataSource = forms.customer.foundset.getDataSource();
|
|
|
|
|
Table Body (tbody) |
---|
id | getFoundSetFilterParams |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getFoundSetFilterParams |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Object[][] |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getFoundSetFilterParams |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get the list of previously defined foundset filters. The result is an array of: [ tableName, dataprovider, operator, value, name ] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} [filterName] – name of the filters to retrieve, get all if not specified. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Object[][] – Array of filter definitions. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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 Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| JSRecord |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getRecord |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get the record object at the index. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {Number} index – int record index |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns JSRecord – Record record. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var record = forms.customer.foundset.getRecord(index);
|
|
|
|
|
Table Body (tbody) |
---|
id | getRecordIndex |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getRecordIndex |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getRecordIndex |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get the record index. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {JSRecord} record – Record |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Number – int index. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var index = forms.customer.foundset.getRecordIndex(record);
|
|
|
|
|
Table Body (tbody) |
---|
id | getRelationName |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getRelationName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getRelationName |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Gets the relation name (null if not a related foundset). |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String – String relation name when related. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var relName = forms.customer.foundset.getRelationName();
|
|
|
|
|
Table Body (tbody) |
---|
id | getSelectedIndex |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getSelectedIndex |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getSelectedIndex |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get the current record index of the foundset. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Number – int current index (1-based) |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//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 Body (tbody) |
---|
id | getSelectedIndexes |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getSelectedIndexes |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number[] |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getSelectedIndexes |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get the selected records indexes. When the founset is in multiSelect mode (see property multiSelect), selection can be a more than 1 index. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Number[] – Array current indexes (1-based) |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var current = forms.customer.foundset.getSelectedIndexes();
var newSelection = new Array();
newSelection[0] = current[0];
forms.customer.foundset.setSelectedIndexes(newSelection);
|
|
|
|
|
Table Body (tbody) |
---|
id | getSelectedRecord |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getSelectedRecord |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| JSRecord |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getSelectedRecord |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get the selected record. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns JSRecord – Record record. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var selectedRecord = forms.customer.foundset.getSelectedRecord();
|
|
|
|
|
Table Body (tbody) |
---|
id | getSelectedRecords |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getSelectedRecords |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| JSRecord[] |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getSelectedRecords |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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) |
---|
| Table Cell (td) |
---|
Returns JSRecord[] – Array current records. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var selectedRecords = forms.customer.foundset.getSelectedRecords();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getSize |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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) |
---|
| Table Cell (td) |
---|
Returns Number – int current size. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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 Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
invertRecords |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| invertRecords |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
forms.customer.foundset.invertRecords();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| isInFind |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Check if this foundset is in find mode. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Boolean – boolean is in find mode. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//Returns true when find was called on this foundset and search has not been called yet
forms.customer.foundset.isInFind();
|
|
|
|
|
Table Body (tbody) |
---|
id | loadAllRecords |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
loadAllRecords |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| loadAllRecords |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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) |
---|
| Table Cell (td) |
---|
Returns Boolean – true if records are loaded, false otherwise. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
forms.customer.foundset.loadAllRecords();
|
|
|
|
|
Table Body (tbody) |
---|
id | loadOmittedRecords |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
loadOmittedRecords |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| loadOmittedRecords |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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) |
---|
| Table Cell (td) |
---|
Returns Boolean – true if records are loaded, false otherwise. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
forms.customer.foundset.loadOmittedRecords();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
loadRecords |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| loadRecords |
Span |
---|
| ([input], [queryArgumentsArray]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Load records with primary key (dataset/number/uuid) or query. Load records can be used in 5 different ways 1) to copy foundset data from another foundset foundset.loadRecords(fs); 2) to load a primary key dataset, will remove related sort! var dataset = databaseManager.getDataSetByQuery(...); foundset.loadRecords(dataset); 3) to load a single record by primary key, will remove related sort! (pk should be a number or UUID) foundset.loadRecords(123); foundset.loadRecords(application.getUUID('6b5e2f5d-047e-45b3-80ee-3a32267b1f20')); 4) to reload all last related records again, if for example when searched in tabpanel foundset.loadRecords(); 5) to load records in to the form based on a query (also known as 'Form by query') foundset.loadRecords(sqlstring,parameters); limitations/requirements for sqlstring are: -must start with 'select' -the selected columns must be the (Servoy Form) table primary key columns (alphabetically ordered like 'select a_id, b_id,c_id ...') -can contain '?' which are replaced with values from the array supplied to parameters argument if the sqlstring contains an 'order by' clause, the records will be sorted accordingly and additional constraints apply: -must contain 'from' keyword -the 'from' must be a comma separated list of table names -must at least select from the table used in Servoy Form -cannot contain 'group by', 'having' or 'union' -all columns must be fully qualified like 'orders.order_id' |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters [input] – foundset/pkdataset/single_pk/query [queryArgumentsArray] – used when input is a query |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Boolean – true if successful |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//Load records can be used in 5 different ways
//1) to copy foundset data from another foundset
//forms.customer.foundset.loadRecords(fs);
//2) to load a primary key dataset, will remove related sort!
//var dataset = databaseManager.getDataSetByQuery(...);
// dataset must match the table primary key columns (alphabetically ordered)
//forms.customer.foundset.loadRecords(dataset);
//3) to load a single record by primary key, will remove related sort! (pk should be a number or UUID)
//forms.customer.foundset.loadRecords(123);
//forms.customer.foundset.loadRecords(application.getUUID('6b5e2f5d-047e-45b3-80ee-3a32267b1f20'));
//4) to reload all last related records again, if for example when searched in tabpanel
//forms.customer.foundset.loadRecords();
//5) to load records in to the form based on a query (also known as 'Form by query')
//forms.customer.foundset.loadRecords(sqlstring,parameters);
//limitations/requirements for sqlstring are:
//-must start with 'select'
//-the selected columns must be the (Servoy Form) table primary key columns (alphabetically ordered like 'select a_id, b_id,c_id ...')
//-can contain '?' which are replaced with values from the array supplied to parameters argument
//if the sqlstring contains an 'order by' clause, the records will be sorted accordingly and additional constraints apply:
//-must contain 'from' keyword
//-the 'from' must be a comma separated list of table names
//-must at least select from the table used in Servoy Form
//-cannot contain 'group by', 'having' or 'union'
//-all columns must be fully qualified like 'orders.order_id'
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| newRecord |
Span |
---|
| ([location], [changeSelection]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Create a new record in the foundset. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters [location] – boolean or number when true the new record is added as the topmost record, when a number, the new record is added at specified index ; defaults to 0. [changeSelection] – boolean when true the selection is changed to the new record; defaults to true. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Number – int index of new record. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
// foreign key data is only filled in for equals (=) relation items
forms.customer.foundset.newRecord();
//forms.customer.foundset.newRecord(2); //adds as second record
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
omitRecord |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| omitRecord |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Omit current record or the record under the given index, to be shown with loadOmittedRecords. If the foundset is in multiselect mode, all selected records are omitted (when no index parameter is used). Note: The omitted records list is discarded when these functions are executed: loadAllRecords, loadRecords(dataset), loadRecords(sqlstring), invertRecords() |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters [index] – index of record to omit. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Boolean – boolean true if all records could be omitted. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var success = forms.customer.foundset.omitRecord();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| relookup |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Perform a relookup for the current record or the record under the given index Lookups are defined in the dataprovider (columns) auto-enter setting and are normally performed over a relation upon record creation. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters [index] – record index (1-based) |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
forms.customer.foundset.relookup(1);
|
|
|
|
|
Table Body (tbody) |
---|
id | removeFoundSetFilterParam |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
removeFoundSetFilterParam |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| removeFoundSetFilterParam |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Remove a named foundset filter. Use clear() or loadAllRecords() to make the filter effective. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} name – String filter name. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Boolean – true if removing the filter succeeded, false otherwise. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var success = forms.customer.foundset.removeFoundSetFilterParam('custFilter');// removes all filters with this name
forms.customer.foundset.loadAllRecords();//to make param(s) effective
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| search |
Span |
---|
| ([clearLastResults], [reduceSearch]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Perform a search and show the results. Must be in find mode when running search (see find()). |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters [clearLastResults] – boolean, clear previous search, default true [reduceSearch] – boolean, reduce (true) or extend (false) previous search results, default true |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Number – int number of rows returned |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var recordCount = forms.customer.foundset.search();
//var recordCount = forms.customer.foundset.search(false,false);//to extend foundset
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
selectRecord |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| selectRecord |
Span |
---|
| (pkid1, [pkid2], [pkidn]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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) |
---|
| Table Cell (td) |
---|
Parameters pkid1 – primary key [pkid2] – second primary key (in case of composite primary key) [pkidn] – nth primary key |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Boolean – true if succeeded. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
forms.customer.foundset.selectRecord(pkid1,pkid2,pkidn);//pks must be alphabetically set! It is also possible to use an array as parameter.
|
|
|
|
|
Table Body (tbody) |
---|
id | setDataProviderValue |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setDataProviderValue |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setDataProviderValue |
Span |
---|
| (dataProviderID, value) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Set a value based on a dataprovider name. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {String} dataProviderID – data provider name {Object} value – value to set |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
forms.customer.foundset.setDataProviderValue('contact_name','mycompany');
|
|
|
|
|
Table Body (tbody) |
---|
id | setSelectedIndex |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setSelectedIndex |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setSelectedIndex |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Set the current record index. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters index – int index to set (1-based) |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//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 Body (tbody) |
---|
id | setSelectedIndexes |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setSelectedIndexes |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setSelectedIndexes |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Set the selected records indexes. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters {Object[]} indexes – An array with indexes to set. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var current = forms.customer.foundset.getSelectedIndexes();
var newSelection = new Array();
newSelection[0] = current[0];
forms.customer.foundset.setSelectedIndexes(newSelection);
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| sort |
Span |
---|
| (sortString, [defer]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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) |
---|
| Table Cell (td) |
---|
Parameters sortString – the specified columns (and sort order) [defer] – boolean when true, the "sortString" will be just stored, without performing a query on the database (the actual sorting will be deferred until the next data loading action). |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
forms.customer.foundset.sort('columnA desc,columnB asc');
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| JSFoundset |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| unrelate |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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) |
---|
| Table Cell (td) |
---|
Returns JSFoundset – FoundSet unrelated foundset. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
forms.customer.foundset.unrelate();
|
|
|
|
|
|