May 02, 2024 17:10 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 Returns Supported Clients Sample Parameters Supported Clients Sample 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 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 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 Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Parameters Supported Clients Sample Supported Clients Sample Parameters Supported Clients SampleSupported Clients
SmartClient
WebClient
Property Summary
Boolean
enabled
Gets or sets the enabled state of a form; also known as "grayed-out".
Boolean
readOnly
Gets or sets the read-only state of a form; also known as "editable"
Note: The field(s) in a form set as read-only can be selected and the field data can be copied to clipboard.
Number
view
Get/Set the current type of view of this form.
Methods Summary
Boolean
deleteAllRecords()
Deletes all records in foundset, resulting in empty foundset.
Boolean
deleteRecord()
Delete current selected record, deletes mulitple selected records incase the foundset is using multiselect.
Boolean
duplicateRecord()
Duplicate current record or record at index in the form foundset.
Boolean
duplicateRecord(location)
Duplicate current record or record at index in the form foundset.
Boolean
duplicateRecord(location)
Duplicate current record or record at index in the form foundset.
Boolean
find()
Set the foundset in find mode.
void
focusField(fieldName, skipReadonly)
Sets focus to a field specified by its name.
void
focusFirstField()
Sets focus to the first field of the form; based on tab order sequence.
Number
getDataProviderMaxLength(name)
Returns the maximum length allowed in the specified dataprovider.
Object
getDataProviderValue(dataProvider)
Gets a value based on the specified dataprovider name.
String
getDataSource()
Get the used datasource.
Boolean
getDesignMode()
Returns the state of this form designmode.
Object
getDesignTimeProperty(key)
Get a design-time property of a form.
JSDataSet
getFormContext()
Gets the forms context where it resides, returns a dataset of its structure to the main controller.
Number
getFormWidth()
Gets the form width in pixels.
Number
getMaxRecordIndex()
Returns the current cached record count of the current foundset.
String
getName()
Get the name of this form.
Number
getPartHeight(partType)
Gets the part height in pixels.
Number
getPartYOffset(partType)
Returns the Y offset of a given part of the form.
Number
getSelectedIndex()
Gets the current record index of the current foundset.
Array
getTabSequence()
Get an array with the names of the components that are part of the tab sequence.
JSWindow
getWindow()
Returns the JSWindow that the form is shown in, or null if the form is not currently showing in a window.
Boolean
invertRecords()
Inverts the current foundset against all rows of the current table; all records that are not in the foundset will become the current foundset.
Boolean
loadAllRecords()
Loads all accessible records from the datasource into the form foundset.
Boolean
loadOmittedRecords()
Loads the records that are currently omitted in the form foundset.
Boolean
loadRecords()
Loads all accessible records from the datasource into the form foundset.
Boolean
loadRecords(foundset)
Loads a (related) foundset into the form.
Boolean
loadRecords(pkdataset)
Loads a primary key dataset, will remove related sort.
Boolean
loadRecords(UUIDpk)
Loads a single record by primary key, will remove related sort.
Boolean
loadRecords(singlenNmber_pk)
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, queryArgumentsArray)
Loads records into form foundset based on a query (also known as 'Form by query').
Boolean
newRecord()
Create a new record in the form foundset.
Boolean
newRecord(insertOnTop)
Create a new record in the form foundset.
Boolean
newRecord(location)
Create a new record in the form foundset.
Boolean
omitRecord()
Omit selected record(s) (add it to omit records list) in form foundset, to be shown with loadOmittedRecords.
void
print()
Print this form with current foundset, without preview.
void
print(printCurrentRecordOnly)
Print this form with current foundset, without preview.
void
print(printCurrentRecordOnly, showPrinterSelectDialog)
Print this form with current foundset, without preview.
void
print(printCurrentRecordOnly, showPrinterSelectDialog, printerJob)
Print this form with current foundset, without preview.
String
printXML()
Print this form with current foundset records to xml format.
String
printXML(printCurrentRecordOnly)
Print this form with current foundset records to xml format.
Boolean
recreateUI()
Recreates the forms UI components, to reflect the latest solution model.
void
relookup()
Performs a relookup for the current foundset record dataproviders.
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.
void
setDataProviderValue(dataprovider, value)
Sets the value based on a specified dataprovider name.
void
setDesignMode(ondrag)
Sets this form in designmode with one or more callback methods.
void
setDesignMode(designMode)
Sets this form in designmode with param true, false will return to normal browse/edit mode.
void
setPageFormat(width, height, leftmargin, rightmargin, topmargin, bottommargin)
Set the page format to use when printing.
void
setPageFormat(width, height, leftmargin, rightmargin, topmargin, bottommargin, orientation)
Set the page format to use when printing.
void
setPageFormat(width, height, leftmargin, rightmargin, topmargin, bottommargin, orientation, units)
Set the page format to use when printing.
void
setPreferredPrinter(printerName)
Set the preferred printer name to use when printing.
void
setSelectedIndex(index)
Sets the current record index of the current foundset.
void
setTabSequence(arrayOfElements)
Set the tab order sequence programatically, by passing the elements references in a javascript array.
void
show()
Shows the form (makes the form visible)
This function does not affect the form foundset in any way.
void
show(window)
Shows the form (makes the form visible)
This function does not affect the form foundset in any way.
void
show(window)
Shows the form (makes the form visible)
This function does not affect the form foundset in any way.
void
showPrintPreview()
Show this form in print preview.
void
showPrintPreview(printCurrentRecordOnly)
Show this form in print preview.
void
showPrintPreview(printCurrentRecordOnly, printerJob)
Show this form in print preview.
void
showPrintPreview(printCurrentRecordOnly, printerJob, zoomFactor)
Show this form in print preview.
void
showRecords(foundset)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(foundset, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(foundset, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(pkdataset)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(pkdataset, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(pkdataset, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(query)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(query, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(query, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(UUIDpk)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(UUIDpk, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(UUIDpk, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(singleNumber_pk)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(singleNumber_pk, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(singleNumber_pk, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(query)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(query, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(query, argumentsArray)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(query, argumentsArray, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(query, argumentsArray, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
showRecords(query, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
void
sort(sortString)
Sorts the form foundset based on the given sort string.
void
sort(sortString, defer)
Sorts the form foundset based on the given sort string.
void
sortDialog()
Show the sort dialog to the user a preselection sortString can be passed, to sort the form foundset.
void
sortDialog(sortString)
Property Details
enabled
Gets or sets the enabled state of a form; also known as "grayed-out".
Notes:
-A disabled element(s) cannot be selected by clicking the form.
-The disabled "grayed" color is dependent on the LAF set in the Servoy Smart Client Application Preferences.
//gets the enabled state of the form
var state = %%prefix%%controller.enabled;
//enables the form for input
%%prefix%%controller.enabled = true;
readOnly
Gets or sets the read-only state of a form; also known as "editable"
Note: The field(s) in a form set as read-only can be selected and the field data can be copied to clipboard.
//gets the read-only state of the form
var state = %%prefix%%controller.readOnly;
//sets the read-only state of the form
%%prefix%%controller.readOnly = true
view
Get/Set the current type of view of this form.
//gets the type of view for this form
var view = %%prefix%%controller.view;
//sets the form to Record view
%%prefix%%controller.view = 0;//RECORD_VIEW
//sets the form to List view
%%prefix%%controller.view = 1;//LIST_VIEW
Methods Details
deleteAllRecords()
Deletes all records in foundset, resulting in empty foundset.
var success = %%prefix%%controller.deleteAllRecords();
deleteRecord()
Delete current selected record, deletes mulitple selected records incase the foundset is using multiselect.
var success = %%prefix%%controller.deleteRecord();
duplicateRecord()
Duplicate current record or record at index in the form foundset.
%%prefix%%controller.duplicateRecord(); //duplicate the current record, adds on top
//%%prefix%%controller.duplicateRecord(false); //duplicate the current record, adds at bottom
//%%prefix%%controller.duplicateRecord(1,2); //duplicate the first record as second record
duplicateRecord(location)
Duplicate current record or record at index in the form foundset.
Boolean
location
true adds the new record as the topmost record
%%prefix%%controller.duplicateRecord(); //duplicate the current record, adds on top
//%%prefix%%controller.duplicateRecord(false); //duplicate the current record, adds at bottom
//%%prefix%%controller.duplicateRecord(1,2); //duplicate the first record as second record
duplicateRecord(location)
Duplicate current record or record at index in the form foundset.
Number
location
adds at specified index
%%prefix%%controller.duplicateRecord(); //duplicate the current record, adds on top
//%%prefix%%controller.duplicateRecord(false); //duplicate the current record, adds at bottom
//%%prefix%%controller.duplicateRecord(1,2); //duplicate the first record as second record
find()
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]"
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()
}
focusField(fieldName, skipReadonly)
Sets focus to a field specified by its name.
If the second parameter is set to true, then readonly fields will be skipped
(the focus will be set to the first non-readonly field located after the field with the specified name; the tab sequence is respected when searching for the non-readonly field).
String
fieldName
the name of the field to be focussed
Boolean
skipReadonly
indication to skip read only fields, if the named field happens to be read only
var tabseq = %%prefix%%controller.getTabSequence();
if (tabseq.length > 1) {
// If there is more than one field in the tab sequence,
// focus the second one and skip over readonly fields.
%%prefix%%controller.focusField(tabseq[1], true);
}
else {
// If there is at most one field in the tab sequence, then focus
// whatever field is first, and don't bother to skip over readonly fields.
%%prefix%%controller.focusField(null, false);
}
focusFirstField()
Sets focus to the first field of the form; based on tab order sequence.
%%prefix%%controller.focusFirstField();
getDataProviderMaxLength(name)
Returns the maximum length allowed in the specified dataprovider.
String
name
the dataprovider name
%%prefix%%controller.getDataProviderMaxLength('name');
getDataProviderValue(dataProvider)
Gets a value based on the specified dataprovider name.
String
dataProvider
the dataprovider name to retieve the value for
var val = %%prefix%%controller.getDataProviderValue('contact_name');
getDataSource()
Get the used datasource.
var dataSource = %%prefix%%controller.getDataSource();
getDesignMode()
Returns the state of this form designmode.
var success = %%prefix%%controller.getDesignMode();
getDesignTimeProperty(key)
Get a design-time property of a form.
String
key
the property name
var prop = forms.orders.controller.getDesignTimeProperty('myprop')
getFormContext()
Gets the forms context where it resides, returns a dataset of its structure to the main controller.
Note1: can't be called in onload, because no context is yet available at this time.
Note2: tabindex is 1 (left) or 2 (right) for a SplitPane and 0 based for the other tabpanels; tabindex1based is the same as tabindex but is 1 based.
//dataset columns: [containername(1),formname(2),tabpanel or beanname(3),tabname(4),tabindex(5),tabindex1based(6)]
//dataset rows: mainform(1) -> parent(2) -> current form(3) (when 3 forms deep)
/** @type {JSDataSet} */
var dataset = %%prefix%%controller.getFormContext();
if (dataset.getMaxRowIndex() > 1)
{
// form is in a tabpanel
var parentFormName = dataset.getValue(1,2)
}
getFormWidth()
Gets the form width in pixels.
var width = %%prefix%%controller.getFormWidth();
getMaxRecordIndex()
Returns the current cached record count of the current foundset.
To return the full foundset count, use: databaseManager.getFoundSetCount(...)
Tip: get the the table count of all rows in a table, use: databaseManager.getTableCount(...)
for ( var i = 1 ; i <= %%prefix%%controller.getMaxRecordIndex() ; i++ )
{
%%prefix%%controller.setSelectedIndex(i);
//do some action per record
}
getName()
Get the name of this form.
var formName = %%prefix%%controller.getName();
getPartHeight(partType)
Gets the part height in pixels.
Number
partType
The type of the part whose height will be returned.
var height = %%prefix%%controller.getPartHeight(JSPart.BODY);
getPartYOffset(partType)
Returns the Y offset of a given part of the form.
Number
partType
The type of the part whose Y offset will be returned.
var offset = %%prefix%%controller.getPartYOffset(JSPart.BODY);
getSelectedIndex()
Gets the current record index of the current foundset.
//gets the current record index in the current foundset
var current = %%prefix%%controller.getSelectedIndex();
//sets the next record in the foundset, will be reflected in UI
%%prefix%%controller.setSelectedIndex(current+1);
getTabSequence()
Get an array with the names of the components that are part of the tab sequence.
The order of the names respects the order of the tab sequence.
Components that are not named will not appear in the returned array, although they may be in the tab sequence.
var tabseq = %%prefix%%controller.getTabSequence();
if (tabseq.length > 1) {
// If there is more than one field in the tab sequence,
// focus the second one and skip over readonly fields.
%%prefix%%controller.focusField(tabseq[1], true);
}
else {
// If there is at most one field in the tab sequence, then focus
// whatever field is first, and don't bother to skip over readonly fields.
%%prefix%%controller.focusField(null, false);
}
getWindow()
Returns the JSWindow that the form is shown in, or null if the form is not currently showing in a window.
var currentWindow = controller.getWindow();
if (currentWindow != null) {
currentWindow.title = 'We have a new title';
} else {
currentWindow = application.createWindow("Window Name", JSWindow.WINDOW, null);
currentWindow(650, 700, 450, 350);
currentWindow = "Window Title";
controller.show(currentWindow);
}
invertRecords()
Inverts the current foundset against all rows of the current table; all records that are not in the foundset will become the current foundset.
%%prefix%%controller.invertRecords();
loadAllRecords()
Loads all accessible records from the datasource into the form foundset.
When the form contains a related foundset it will be replaced by a default foundset on same datasource.
Notes:
-the default foundset is always limited by filters, if databaseManager.addFoundSetFilterParam function is used.
-typical use is loading the normal foundset again after form usage in a related tabpanel
%%prefix%%controller.loadAllRecords();
loadOmittedRecords()
Loads the records that are currently omitted in the form foundset.
%%prefix%%controller.loadOmittedRecords();
loadRecords()
Loads all accessible records from the datasource into the form foundset. Typical usage is loading records after search in related tabpanel.
The difference to loadAllRecords() is that related foundset will load related records.
//to reload all last (related) records again, if for example after a search in related tabpanel
%%prefix%%controller.loadRecords();
loadRecords(foundset)
Loads a (related) foundset into the form.
The form will no longer share the default foundset with forms of the same datasource, use loadAllRecords to restore the default foundset.
This will really update the foundset instance itself of the form, so now existing foundset is altered just the new foundset is shown.
This is different then doing foundset.loadRecords(foundset) because that just alters the current foundset and doesn't do anything with the foundset
that is given.
JSFoundSet
foundset
to load
//to load a (related)foundset into the form.
//the form will no longer share the default foundset with forms of the same datasource, use loadAllRecords to restore the default foundset
%%prefix%%controller.loadRecords(order_to_orderdetails);
loadRecords(pkdataset)
Loads a primary key dataset, will remove related sort. Tries to preserve selection based on primary key, otherwise first record is selected.
JSDataSet
pkdataset
to load
//to load a primary key dataset, will remove related sort
//var dataset = databaseManager.getDataSetByQuery(...);
// dataset must match the table primary key columns (alphabetically ordered)
%%prefix%%controller.loadRecords(dataset);
loadRecords(UUIDpk)
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().
UUID
UUIDpk
to load
%%prefix%%controller.loadRecords(application.getUUID('6b5e2f5d-047e-45b3-80ee-3a32267b1f20'));
loadRecords(singlenNmber_pk)
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().
Number
singlenNmber_pk
to load
%%prefix%%controller.loadRecords(123);
loadRecords(queryString)
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.
Tries to preserve selection based on primary key, otherwise first record is selected.
see foundset.loadRecords(QBSelect).
When possible, the foundset will be loaded with the given query.
This is not always possible because the foundset needs to manipulate the query when adding conditions and joins.
In that case the query will be wrapped: select pk from tab where pk = (queryString)
The result is the same, except for the ordering in the queryString which will be ignored.
The query will be wrapped when one of the following is true:
<ul>
<li>you have no order-by clause</li>
<li>you have no from keyword</li>
<li>your query is not fully qualified on the main table</li>
<li>you have a group-by, having, join or union keyword</li>
</ul>
String
queryString
to load
%%prefix%%controller.loadRecords(sqlstring);
loadRecords(queryString, queryArgumentsArray)
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.
Tries to preserve selection based on primary key, otherwise first record is selected.
see foundset.loadRecords(QBSelect).
When possible, the foundset will be loaded with the given query.
This is not always possible because the foundset needs to manipulate the query when adding conditions and joins.
In that case the query will be wrapped: select pk from tab where pk = (queryString)
The result is the same, except for the ordering in the queryString which will be ignored.
The query will be wrapped when one of the following is true:
<ul>
<li>you have no order-by clause</li>
<li>you have no from keyword</li>
<li>your query is not fully qualified on the main table</li>
<li>you have a group-by, having, join or union keyword</li>
</ul>
String
queryString
to load
Array
queryArgumentsArray
the arguments to replace the questions marks in the queryString
%%prefix%%controller.loadRecords(sqlstring,parameters);
newRecord()
Create a new record in the form foundset.
// foreign key data is only filled in for equals (=) relation items
%%prefix%%controller.newRecord();//default adds on top
//%%prefix%%controller.newRecord(false); //adds at bottom
//%%prefix%%controller.newRecord(2); //adds as second record
newRecord(insertOnTop)
Create a new record in the form foundset.
Boolean
insertOnTop
true adds the new record as the topmost record
// foreign key data is only filled in for equals (=) relation items
%%prefix%%controller.newRecord();//default adds on top
//%%prefix%%controller.newRecord(false); //adds at bottom
//%%prefix%%controller.newRecord(2); //adds as second record
newRecord(location)
Create a new record in the form foundset.
Number
location
adds at specified index
// foreign key data is only filled in for equals (=) relation items
%%prefix%%controller.newRecord();//default adds on top
//%%prefix%%controller.newRecord(false); //adds at bottom
//%%prefix%%controller.newRecord(2); //adds as second record
omitRecord()
Omit selected record(s) (add it to omit records list) in form foundset, to be shown with loadOmittedRecords.
This operation returns false only when form foundset is in bad state (table not accessible or not having a valid selected record)
or the record is in an edit state and can't be saved (autosave is false).
Note: The omitted records are discarded when these functions are executed: loadAllRecords, loadRecords(dataset), loadRecords(sqlstring), invert
var success = %%prefix%%controller.omitRecord();
print()
Print this form with current foundset, without preview.
//print this form (with foundset records)
%%prefix%%controller.print();
//print only current record (no printerSelectDialog) to pdf plugin printer
//%%prefix%%controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:/temp/out.pdf'));
print(printCurrentRecordOnly)
Print this form with current foundset, without preview.
Boolean
printCurrentRecordOnly
to print the current record only
//print this form (with foundset records)
%%prefix%%controller.print();
//print only current record (no printerSelectDialog) to pdf plugin printer
//%%prefix%%controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:/temp/out.pdf'));
print(printCurrentRecordOnly, showPrinterSelectDialog)
Print this form with current foundset, without preview.
Boolean
printCurrentRecordOnly
to print the current record only
Boolean
showPrinterSelectDialog
to show the printer select dialog (default printer is normally used)
//print this form (with foundset records)
%%prefix%%controller.print();
//print only current record (no printerSelectDialog) to pdf plugin printer
//%%prefix%%controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:/temp/out.pdf'));
print(printCurrentRecordOnly, showPrinterSelectDialog, printerJob)
Print this form with current foundset, without preview.
Boolean
printCurrentRecordOnly
to print the current record only
Boolean
showPrinterSelectDialog
to show the printer select dialog (default printer is normally used)
Object
printerJob
print to plugin printer job, see pdf printer plugin for example
//print this form (with foundset records)
%%prefix%%controller.print();
//print only current record (no printerSelectDialog) to pdf plugin printer
//%%prefix%%controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:/temp/out.pdf'));
printXML()
Print this form with current foundset records to xml format.
//TIP: see also plugins.file.writeXMLFile(...)
var xml = %%prefix%%controller.printXML();
//print only current record
//var xml = %%prefix%%controller.printXML(true);
printXML(printCurrentRecordOnly)
Print this form with current foundset records to xml format.
Boolean
printCurrentRecordOnly
to print the current record only
//TIP: see also plugins.file.writeXMLFile(...)
var xml = %%prefix%%controller.printXML();
//print only current record
//var xml = %%prefix%%controller.printXML(true);
recreateUI()
Recreates the forms UI components, to reflect the latest solution model.
Use this after altering the elements via solutionModel at the JSForm of this form.
// get the solution model JSForm
var form = solutionModel.getForm("myForm");
// get the JSField of the form
var field = form.getField("myField");
// alter the field
field.x = field.x + 10;
// recreate the runtime forms ui to reflect the changes.
%%prefix%%controller.recreateUI();
relookup()
Performs a relookup for the current foundset record dataproviders.
Lookups are defined in the dataprovider (columns) auto-enter setting and are normally performed over a relation upon record creation.
%%prefix%%controller.relookup();
search()
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.
var recordCount = %%prefix%%foundset.search();
//var recordCount = %%prefix%%foundset.search(false,false); //to extend foundset
search(clearLastResults)
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.
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)
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.
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
setDataProviderValue(dataprovider, value)
Sets the value based on a specified dataprovider name.
String
dataprovider
the dataprovider name to set the value for
Object
value
the value to set in the dataprovider
%%prefix%%controller.setDataProviderValue('contact_name','mycompany');
setDesignMode(ondrag)
Sets this form in designmode with one or more callback methods.
Function
ondrag
onDrag method reference
var form = forms["selectedFormName"];
if (!form.controller.getDesignMode())
{
// Set the current form in designmode with no callbacks
form.controller.setDesignMode(true);
// Set the current form in designmode with callbacks
// where onDrag, onDrop, onSelect, onResize are names of form methods (not from "selectedFormName" form)
// form.controller.setDesignMode(onDrag, onDrop, onSelect, onResize);
}
//Set the current form out of designmode (to normal browse)
//form.controller.setDesignMode(false);
setDesignMode(designMode)
Sets this form in designmode with param true, false will return to normal browse/edit mode.
Boolean
designMode
sets form in design mode if true, false ends design mode.
var form = forms["selectedFormName"];
if (!form.controller.getDesignMode())
{
// Set the current form in designmode with no callbacks
form.controller.setDesignMode(true);
// Set the current form in designmode with callbacks
// where onDrag, onDrop, onSelect, onResize are names of form methods (not from "selectedFormName" form)
// form.controller.setDesignMode(onDrag, onDrop, onSelect, onResize);
}
//Set the current form out of designmode (to normal browse)
//form.controller.setDesignMode(false);
setPageFormat(width, height, leftmargin, rightmargin, topmargin, bottommargin)
Set the page format to use when printing.
Orientation values:
0 - Landscape mode
1 - Portrait mode
Units values:
0 - millimeters
1 - inches
2 - pixels
Note: The unit specified for width, height and all margins MUST be the same.
Number
width
the specified width of the page to be printed.
Number
height
the specified height of the page to be printed.
Number
leftmargin
the specified left margin of the page to be printed.
Number
rightmargin
the specified right margin of the page to be printed.
Number
topmargin
the specified top margin of the page to be printed.
Number
bottommargin
the specified bottom margin of the page to be printed.
//Set page format to a custom size of 100x200 pixels with 10 pixel margins on all sides in portrait mode
%%prefix%%controller.setPageFormat(100, 200, 10, 10, 10, 10);
//Set page format to a custom size of 100x200 pixels with 10 pixel margins on all sides in landscape mode
%%prefix%%controller.setPageFormat(100, 200, 10, 10, 10, 10, SM_ORIENTATION.LANDSCAPE);
//Set page format to a custom size of 100x200 mm in landscape mode
%%prefix%%controller.setPageFormat(100, 200, 0, 0, 0, 0, SM_ORIENTATION.LANDSCAPE, SM_UNITS.MM);
//Set page format to a custom size of 100x200 inch in portrait mode
%%prefix%%controller.setPageFormat(100, 200, 0, 0, 0, 0, SM_ORIENTATION.PORTRAIT, SM_UNITS.INCH);
setPageFormat(width, height, leftmargin, rightmargin, topmargin, bottommargin, orientation)
Set the page format to use when printing.
Orientation values:
0 - Landscape mode
1 - Portrait mode
Units values:
0 - millimeters
1 - inches
2 - pixels
Note: The unit specified for width, height and all margins MUST be the same.
Number
width
the specified width of the page to be printed.
Number
height
the specified height of the page to be printed.
Number
leftmargin
the specified left margin of the page to be printed.
Number
rightmargin
the specified right margin of the page to be printed.
Number
topmargin
the specified top margin of the page to be printed.
Number
bottommargin
the specified bottom margin of the page to be printed.
Number
orientation
the specified orientation of the page to be printed; the default is Portrait mode
//Set page format to a custom size of 100x200 pixels with 10 pixel margins on all sides in portrait mode
%%prefix%%controller.setPageFormat(100, 200, 10, 10, 10, 10);
//Set page format to a custom size of 100x200 pixels with 10 pixel margins on all sides in landscape mode
%%prefix%%controller.setPageFormat(100, 200, 10, 10, 10, 10, SM_ORIENTATION.LANDSCAPE);
//Set page format to a custom size of 100x200 mm in landscape mode
%%prefix%%controller.setPageFormat(100, 200, 0, 0, 0, 0, SM_ORIENTATION.LANDSCAPE, SM_UNITS.MM);
//Set page format to a custom size of 100x200 inch in portrait mode
%%prefix%%controller.setPageFormat(100, 200, 0, 0, 0, 0, SM_ORIENTATION.PORTRAIT, SM_UNITS.INCH);
setPageFormat(width, height, leftmargin, rightmargin, topmargin, bottommargin, orientation, units)
Set the page format to use when printing.
Orientation values:
0 - Landscape mode
1 - Portrait mode
Units values:
0 - millimeters
1 - inches
2 - pixels
Note: The unit specified for width, height and all margins MUST be the same.
Number
width
the specified width of the page to be printed.
Number
height
the specified height of the page to be printed.
Number
leftmargin
the specified left margin of the page to be printed.
Number
rightmargin
the specified right margin of the page to be printed.
Number
topmargin
the specified top margin of the page to be printed.
Number
bottommargin
the specified bottom margin of the page to be printed.
Number
orientation
the specified orientation of the page to be printed; the default is Portrait mode
Number
units
the specified units for the width and height of the page to be printed; the default is pixels
//Set page format to a custom size of 100x200 pixels with 10 pixel margins on all sides in portrait mode
%%prefix%%controller.setPageFormat(100, 200, 10, 10, 10, 10);
//Set page format to a custom size of 100x200 pixels with 10 pixel margins on all sides in landscape mode
%%prefix%%controller.setPageFormat(100, 200, 10, 10, 10, 10, SM_ORIENTATION.LANDSCAPE);
//Set page format to a custom size of 100x200 mm in landscape mode
%%prefix%%controller.setPageFormat(100, 200, 0, 0, 0, 0, SM_ORIENTATION.LANDSCAPE, SM_UNITS.MM);
//Set page format to a custom size of 100x200 inch in portrait mode
%%prefix%%controller.setPageFormat(100, 200, 0, 0, 0, 0, SM_ORIENTATION.PORTRAIT, SM_UNITS.INCH);
setPreferredPrinter(printerName)
Set the preferred printer name to use when printing.
String
printerName
The name of the printer to be used when printing.
%%prefix%%controller.setPreferredPrinter('HP Laser 2200');
setSelectedIndex(index)
Sets the current record index of the current foundset.
Number
index
the index to select
//gets the current record index in the current foundset
var current = %%prefix%%controller.getSelectedIndex();
//sets the next record in the foundset, will be reflected in UI
%%prefix%%controller.setSelectedIndex(current+1);
setTabSequence(arrayOfElements)
Set the tab order sequence programatically, by passing the elements references in a javascript array.
Array
arrayOfElements
array containing the element references
%%prefix%%controller.setTabSequence([%%prefix%%elements.fld_order_id, %%prefix%%elements.fld_order_amount]);
show()
Shows the form (makes the form visible)
This function does not affect the form foundset in any way.
// show the form in the current window/dialog
%%prefix%%controller.show();
// show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.show(w);
// show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.show(w);
// or %%prefix%%controller.show("mydialog");
//show the form in the main window
//%%prefix%%controller.show(null);
show(window)
Shows the form (makes the form visible)
This function does not affect the form foundset in any way.
JSWindow
window
the window in which this form should be shown, given as a window object
// show the form in the current window/dialog
%%prefix%%controller.show();
// show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.show(w);
// show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.show(w);
// or %%prefix%%controller.show("mydialog");
//show the form in the main window
//%%prefix%%controller.show(null);
show(window)
Shows the form (makes the form visible)
This function does not affect the form foundset in any way.
String
window
the window in which this form should be shown, specified by the name of an existing window
// show the form in the current window/dialog
%%prefix%%controller.show();
// show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.show(w);
// show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.show(w);
// or %%prefix%%controller.show("mydialog");
//show the form in the main window
//%%prefix%%controller.show(null);
showPrintPreview()
Show this form in print preview.
//shows this form (with foundset records) in print preview
%%prefix%%controller.showPrintPreview();
//to print preview current record only
//%%prefix%%controller.showPrintPreview(true);
//to print preview current record only with 125% zoom factor;
//%%prefix%%controller.showPrintPreview(true, null, 125);
showPrintPreview(printCurrentRecordOnly)
Show this form in print preview.
Boolean
printCurrentRecordOnly
to print the current record only
//shows this form (with foundset records) in print preview
%%prefix%%controller.showPrintPreview();
//to print preview current record only
//%%prefix%%controller.showPrintPreview(true);
//to print preview current record only with 125% zoom factor;
//%%prefix%%controller.showPrintPreview(true, null, 125);
showPrintPreview(printCurrentRecordOnly, printerJob)
Show this form in print preview.
Boolean
printCurrentRecordOnly
to print the current record only
Object
printerJob
print to plugin printer job, see pdf printer plugin for example (incase print is used from printpreview)
//shows this form (with foundset records) in print preview
%%prefix%%controller.showPrintPreview();
//to print preview current record only
//%%prefix%%controller.showPrintPreview(true);
//to print preview current record only with 125% zoom factor;
//%%prefix%%controller.showPrintPreview(true, null, 125);
showPrintPreview(printCurrentRecordOnly, printerJob, zoomFactor)
Show this form in print preview.
Boolean
printCurrentRecordOnly
to print the current record only
Object
printerJob
print to plugin printer job, see pdf printer plugin for example (incase print is used from printpreview)
Number
zoomFactor
a specified number value from 10-400
//shows this form (with foundset records) in print preview
%%prefix%%controller.showPrintPreview();
//to print preview current record only
//%%prefix%%controller.showPrintPreview(true);
//to print preview current record only with 125% zoom factor;
//%%prefix%%controller.showPrintPreview(true, null, 125);
showRecords(foundset)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
Object
foundset
the foundset to load before showing the form.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(foundset, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
JSFoundSet
foundset
the foundset to load before showing the form.
JSWindow
window
the window in which this form should be shown, given as a window object.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(foundset, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
JSFoundSet
foundset
the foundset to load before showing the form.
String
window
the window in which this form should be shown, specified by the name of an existing window.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(pkdataset)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
JSDataSet
pkdataset
the pkdataset to load before showing the form.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(pkdataset, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
JSDataSet
pkdataset
the pkdataset to load before showing the form.
JSWindow
window
the window in which this form should be shown, given as a window object.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(pkdataset, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
JSDataSet
pkdataset
the pkdataset to load before showing the form.
String
window
the window in which this form should be shown, specified by the name of an existing window.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(query)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
QBSelect
query
the query to load before showing the form.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(query, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
QBSelect
query
the query to load before showing the form.
JSWindow
window
the window in which this form should be shown, given as a window object.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(query, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
QBSelect
query
the query to load before showing the form.
String
window
the window in which this form should be shown, specified by the name of an existing window.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(UUIDpk)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
UUID
UUIDpk
the UUIDpk to load before showing the form.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(UUIDpk, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
UUID
UUIDpk
the UUIDpk to load before showing the form.
JSWindow
window
the window in which this form should be shown, given as a window object.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(UUIDpk, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
UUID
UUIDpk
the UUIDpk to load before showing the form.
String
window
the window in which this form should be shown, specified by the name of an existing window.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(singleNumber_pk)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
Number
singleNumber_pk
the singleNumber_pk to load before showing the form.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(singleNumber_pk, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
Number
singleNumber_pk
the singleNumber_pk to load before showing the form.
JSWindow
window
the window in which this form should be shown, given as a window object
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(singleNumber_pk, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
Number
singleNumber_pk
the singleNumber_pk to load before showing the form.
String
window
the window in which this form should be shown, specified by the name of an existing window.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(query)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
String
query
the query to load before showing the form.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(query, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
String
query
the query to load before showing the form.
JSWindow
window
the window in which this form should be shown, given as a window object
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(query, argumentsArray)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
String
query
the query to load before showing the form.
Array
argumentsArray
the array of arguments for the query
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(query, argumentsArray, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
String
query
the query to load before showing the form.
Array
argumentsArray
the array of arguments for the query
JSWindow
window
the window in which this form should be shown, given as a window object
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(query, argumentsArray, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
String
query
the query to load before showing the form.
Array
argumentsArray
the array of arguments for the query
String
window
the window in which this form should be shown, specified by the name of an existing window.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
showRecords(query, window)
Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
String
query
the query to load before showing the form.
String
window
the window in which this form should be shown, specified by the name of an existing window.
%%prefix%%controller.showRecords(foundset);
// load foundset & show the form in newly created named modal dialog
var w = application.createWindow("mydialog", JSWindow.MODAL_DIALOG);
%%prefix%%controller.showRecords(foundset, w);
// load foundset & show the form in an existing window/dialog
var w = application.getWindow("mydialog"); // use null name for main app. window
%%prefix%%controller.showRecords(foundset, w);
//%%prefix%%controller.showRecords(foundset, "mydialog");
sort(sortString)
Sorts the form foundset based on the given sort string.
Tries to preserve selection based on primary key. If first record is selected or cannot select old record it will select first record after sort.
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.
String
sortString
the specified columns (and sort order)
%%prefix%%controller.sort('columnA desc,columnB asc');
sort(sortString, defer)
Sorts the form foundset based on the given sort string.
Tries to preserve selection based on primary key. If first record is selected or cannot select old record it will select first record after sort.
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.
String
sortString
the specified columns (and sort order)
Boolean
defer
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%%controller.sort('columnA desc,columnB asc');
sortDialog()
Show the sort dialog to the user a preselection sortString can be passed, to sort the form foundset.
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.
%%prefix%%controller.sortDialog('columnA desc,columnB asc');
sortDialog(sortString)
String
sortString
the specified columns (and sort order)
%%prefix%%controller.sortDialog('columnA desc,columnB asc');